diff options
author | zsloan | 2018-01-30 10:30:22 -0600 |
---|---|---|
committer | GitHub | 2018-01-30 10:30:22 -0600 |
commit | 1a00b3976f770865f47d4526db92131704b55797 (patch) | |
tree | 6fa4e488c9c601a5907e0c251fa7eec7f4a94a12 /wqflask | |
parent | 4634cf87761980a1682473211259698b7be720e4 (diff) | |
parent | f60d49527bedfc1ecda401f49fae9c9a5bbcf5f9 (diff) | |
download | genenetwork2-1a00b3976f770865f47d4526db92131704b55797.tar.gz |
Merge pull request #274 from pjotrp/pjotr
Add gunicorn support
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/__init__.py | 1 | ||||
-rw-r--r-- | wqflask/run_gunicorn.py | 19 | ||||
-rw-r--r-- | wqflask/runserver.py | 2 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 2 | ||||
-rw-r--r-- | wqflask/wsgi.py | 4 |
5 files changed, 26 insertions, 2 deletions
diff --git a/wqflask/__init__.py b/wqflask/__init__.py index 315b709e..e69de29b 100644 --- a/wqflask/__init__.py +++ b/wqflask/__init__.py @@ -1 +0,0 @@ -from wqflask import app diff --git a/wqflask/run_gunicorn.py b/wqflask/run_gunicorn.py new file mode 100644 index 00000000..14a2d689 --- /dev/null +++ b/wqflask/run_gunicorn.py @@ -0,0 +1,19 @@ +# Run with gunicorn, see ./bin/genenetwork2 for an example +# +# Run standalone with +# +# ./bin/genenetwork2 ./etc/default_settings.py -c run_gunicorn.py + +# from flask import Flask +# application = Flask(__name__) + +print "Starting up Gunicorn process" + +from wqflask import app + +@app.route("/gunicorn") +def hello(): + return "<h1 style='color:blue'>Hello There!</h1>" + +if __name__ == "__main__": + app.run(host='0.0.0.0') diff --git a/wqflask/runserver.py b/wqflask/runserver.py index 50f134db..a0c76e51 100644 --- a/wqflask/runserver.py +++ b/wqflask/runserver.py @@ -1,5 +1,7 @@ # Starts the webserver with the ./bin/genenetwork2 command # +# This uses Werkzeug WSGI, see ./run_gunicorn.py for the alternative +# # Please note, running with host set externally below combined with # debug mode is a security risk unless you have a firewall setup, e.g. # diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index d8f5616d..4e81c29c 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -766,7 +766,7 @@ def corr_scatter_plot_page(): def submit_bnw(): logger.error(request.url) template_vars = get_bnw_input(request.form) - return render_template("empty_collection.html", **{'tool':'Correlation Matrix'}) + return render_template("empty_collection.html", **{'tool':'Correlation Matrix'}) # Todo: Can we simplify this? -Sam def sharing_info_page(): diff --git a/wqflask/wsgi.py b/wqflask/wsgi.py new file mode 100644 index 00000000..be9c7b37 --- /dev/null +++ b/wqflask/wsgi.py @@ -0,0 +1,4 @@ +from run_gunicorn import app as application # expect application as a name + +if __name__ == "__main__": + application.run() |