mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-11-21 10:56:10 +00:00
ready for 0.9.8 release
This commit is contained in:
@@ -114,7 +114,6 @@ int init_uwsgi_app(int loader, void *arg1, struct wsgi_request *wsgi_req, PyThre
|
||||
uwsgi_log("%s = %s\n", PyString_AsString(k), PyString_AsString(env_value));
|
||||
|
||||
if (PyObject_SetItem(py_environ, k, env_value)) {
|
||||
uwsgi_log("cazzo\n");
|
||||
PyErr_Print();
|
||||
}
|
||||
|
||||
@@ -521,6 +520,9 @@ PyObject *uwsgi_file_loader(void *arg1) {
|
||||
PyObject *wsgi_file_module, *wsgi_file_dict;
|
||||
PyObject *wsgi_file_callable;
|
||||
|
||||
char *callable = up.callable;
|
||||
if (!callable) callable = "application";
|
||||
|
||||
wsgi_file_module = uwsgi_pyimport_by_filename("uwsgi_wsgi_file", filename);
|
||||
// no need to check here for module import as it is already done by uwsgi_pyimport_by_file
|
||||
|
||||
@@ -530,7 +532,7 @@ PyObject *uwsgi_file_loader(void *arg1) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
wsgi_file_callable = PyDict_GetItemString(wsgi_file_dict, "application");
|
||||
wsgi_file_callable = PyDict_GetItemString(wsgi_file_dict, callable);
|
||||
if (!wsgi_file_callable) {
|
||||
PyErr_Print();
|
||||
uwsgi_log( "unable to find \"application\" callable in file %s\n", filename);
|
||||
|
||||
@@ -3796,7 +3796,8 @@ void uwsgi_init_all_apps() {
|
||||
}
|
||||
|
||||
// no app initialized and virtualhosting enabled
|
||||
if (uwsgi.apps_cnt == 0 && uwsgi.vhost) {
|
||||
if (uwsgi.apps_cnt == 0) {
|
||||
uwsgi_log("*** no app loaded. going in full dynamic mode ***\n");
|
||||
uwsgi.apps_cnt = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hello World!"
|
||||
@@ -0,0 +1,6 @@
|
||||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hello World! app2 !!!"
|
||||
@@ -0,0 +1,6 @@
|
||||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hello World! app3"
|
||||
@@ -0,0 +1,6 @@
|
||||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hello World! app4"
|
||||
@@ -0,0 +1,6 @@
|
||||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hello World! app5"
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
worker_processes 1;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip on;
|
||||
|
||||
upstream uwsgi_server {
|
||||
server 127.0.0.1:3031;
|
||||
}
|
||||
|
||||
include uwsgi_params;
|
||||
uwsgi_param UWSGI_FILE $app;
|
||||
uwsgi_param UWSGI_PYHOME $virtualenv;
|
||||
|
||||
|
||||
server {
|
||||
listen 8026;
|
||||
server_name flask001;
|
||||
set $app vhosttest/flask001/app1.py;
|
||||
set $virtualenv vhosttest/venv001;
|
||||
location / {
|
||||
uwsgi_pass uwsgi_server;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8026;
|
||||
server_name flask002;
|
||||
set $app vhosttest/flask002/app2.py;
|
||||
set $virtualenv vhosttest/venv001;
|
||||
location / {
|
||||
uwsgi_pass uwsgi_server;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user