Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Flask web应用程序的某些页面在几个小时后关闭_Python_Nginx_Flask_Uwsgi - Fatal编程技术网

Python Flask web应用程序的某些页面在几个小时后关闭

Python Flask web应用程序的某些页面在几个小时后关闭,python,nginx,flask,uwsgi,Python,Nginx,Flask,Uwsgi,我正在CentOS机箱上托管一个带有nginx和uWSGI的Flask应用程序。几个小时后,我的一个页面出现500内部服务器错误你看到下面我的配置中有什么东西向你跳出来了吗 我的ers\u portal\u nginx.conf: server { listen 80; server_name www.mydomain.com; location / { try_files $uri @app; } location @app { in

我正在CentOS机箱上托管一个带有nginx和uWSGI的Flask应用程序。几个小时后,我的一个页面出现
500内部服务器错误
你看到下面我的配置中有什么东西向你跳出来了吗

我的
ers\u portal\u nginx.conf

server {
    listen      80;
    server_name www.mydomain.com;

    location / { try_files $uri @app; }
    location @app {
        include uwsgi_params;
        uwsgi_pass unix:/home/metheuser/webapps/ers_portal/run_web_uwsgi.sock;
    }
}
我的
ers\u门户网站\u uwsgi.ini

[uwsgi]
#user info
uid = metheuser
gid = ers_group

#application's base folder
base = /home/metheuser/webapps/ers_portal

#python module to import
app = run_web
module = %(app)

home = %(base)/ers_portal_venv
pythonpath = %(base)

#socket file's location
socket = /home/metheuser/webapps/ers_portal/%n.sock

#permissions for the socket file
chmod-socket    = 666

#uwsgi varible only, does not relate to your flask application
callable = app

#location of log files
logto = /home/metheuser/webapps/ers_portal/logs/%n.log
my
views.py的相关部分

data_modification_time = None
data = None
def reload_data():
    global data_modification_time, data, sites, column_names
    filename = '/home/metheuser/webapps/ers_portal/app/static/' + ec.dd_filename
    mtime = os.stat(filename).st_mtime
    if data_modification_time != mtime:
        data_modification_time = mtime
        with open(filename) as f:
            data = pickle.load(f)
    return data

@a bunch of authentication stuff...

@app.route('/')
@app.route('/index')
def index():
    return render_template("index.html",
                           title = 'Main',)

@app.route('/login', methods = ['GET', 'POST'])
def login():
    login stuff...

@app.route('/my_table')
@login_required
def my_table():
    print 'trying to access data table...'
    data = reload_data()
    return render_template("my_table.html",
                           title = "Rundata Viewer",
                           sts = sites,
                           cn = column_names,
                           data = data) #  dictionary of data
我通过yum安装了nginx(昨天) 我正在使用通过pip安装在我的venv中的uWSGI 我在CentOS 6 我的所有设置都非常类似于,这意味着所有配置都在我的应用程序文件夹中,/etc/nginx/nginx.conf被符号链接到

我的uwsgi日志显示:

Wed Jun 11 17:20:01 2014 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 287] during GET /whm-server-status (127.0.0.1)
IOError: write error
[pid: 9586|app: 0|req: 135/135] 127.0.0.1 () {24 vars in 292 bytes} [Wed Jun 11 17:20:01 2014] GET /whm-server-status => generated 0 bytes in 3 msecs (HTTP/1.0 404) 2 headers in 0 bytes (0 switches on core 0)
工作时,
视图
my_表
”路由中的print语句将打印到日志文件中。但一旦它停止工作就不会

有什么想法吗