Commit b2b6461f6913ca1251b9859f911e027e22b29fcd
1 parent
ebc1a105
Exists in
rhitier-dev
Add wsgi script
Showing
1 changed file
with
42 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,42 @@ |
1 | +# | |
2 | +# Simple wsgi wrapper to run flask app through apache. | |
3 | +# | |
4 | +# Relies on an apache2 virtualhost configuration. | |
5 | +# See ./resources/apache2-virtual-host.conf | |
6 | +# | |
7 | +# It merely calls the app factory and exports it as | |
8 | +# the application variable. | |
9 | + | |
10 | +# The apache WSGIDaemonProcess allows us to set | |
11 | +# a virtualenv | |
12 | +# a pythonpath | |
13 | + | |
14 | +# Instead we could: | |
15 | +# | |
16 | +## 1- activate venv | |
17 | +# python_home = '/var/www/html/app-web/' | |
18 | +# activate_this = python_home + 'venv/bin/activate_this.py' | |
19 | +# with open(activate_this) as file_: | |
20 | +# exec(file_.read(), dict(__file__=activate_this)) | |
21 | +# | |
22 | +## 2- set a python path | |
23 | +# sys.path.insert(0, '/var/www/html/app-web/') | |
24 | +# | |
25 | +## 3- set some logging facilities | |
26 | +# import logging, sys | |
27 | +# logging.basicConfig(stream=sys.stderr) | |
28 | + | |
29 | +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
30 | + | |
31 | +# | |
32 | +# Main Part | |
33 | +# | |
34 | + | |
35 | +# simply use application already set in main app file | |
36 | +# | |
37 | +from web.run import app as application | |
38 | + | |
39 | + | |
40 | + | |
41 | + | |
42 | +# vim: ft=python | ... | ... |