Mercurial > odfcast
annotate main.py @ 79:bd3e5fdd8398 1.0
Add apache site configuraton file for odfcase as wsgi application.
Put the file apache-site.conf into /etc/apache2/sites-available/.
It assumes that odfcast is installed as
/home/mpuls/odfcast/releases/current and that there's a python
environment with its site-packages in
/home/mpuls/odfcast/env/lib/python2.7/site-packages. This is the setup used on the mpuls staging servers.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Wed, 25 Feb 2015 19:36:21 +0100 |
parents | dcf870775c26 |
children |
rev | line source |
---|---|
0
4a34f72f036b
Add initial conversion service
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
1 # -*- coding: utf-8 -*- |
4a34f72f036b
Add initial conversion service
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
2 if __name__ == "__main__": |
37
5c3aba401382
Move templates and static directories to odfcast
Björn Ricks <bjoern.ricks@intevation.de>
parents:
30
diff
changeset
|
3 from odfcast import app |
69
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
4 |
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
5 server_name = app.config['SERVER_NAME'] |
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
6 if server_name and ':' in server_name: |
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
7 host, port = server_name.rsplit(':', 1) |
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
8 port = int(port) |
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
9 else: |
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
10 port = 5000 |
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
11 host = "127.0.0.1" |
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
12 |
dcf870775c26
Add compability with flask 0.8
Björn Ricks <bjoern.ricks@intevation.de>
parents:
37
diff
changeset
|
13 app.run(host=host, port=port) |