| 1 | # -*- coding: utf-8 -*- |
|---|
| 2 | """ |
|---|
| 3 | Zine mod_wsgi Runner |
|---|
| 4 | ~~~~~~~~~~~~~~~~~~~~ |
|---|
| 5 | |
|---|
| 6 | Run Zine in mod_wsgi. For help on configuration have a look at the |
|---|
| 7 | README file. |
|---|
| 8 | |
|---|
| 9 | :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details. |
|---|
| 10 | :license: BSD, see LICENSE for more details. |
|---|
| 11 | """ |
|---|
| 12 | |
|---|
| 13 | # path to the instance. the folder for the instance must exist, |
|---|
| 14 | # if there is not instance information in that folder the websetup |
|---|
| 15 | # will show an assistent |
|---|
| 16 | INSTANCE_FOLDER = '/path/to/instance/folder' |
|---|
| 17 | |
|---|
| 18 | # path to the Zine application code. |
|---|
| 19 | ZINE_LIB = '/usr/lib/zine' |
|---|
| 20 | |
|---|
| 21 | # these values can be use to override database pool settings. |
|---|
| 22 | # see deployment guide for more details. |
|---|
| 23 | POOL_SIZE = None |
|---|
| 24 | POOL_RECYCLE = None |
|---|
| 25 | POOL_TIMEOUT = None |
|---|
| 26 | |
|---|
| 27 | # if you are proxying into zine somehow (caching proxies or external |
|---|
| 28 | # fastcgi servers) set this value to True to enable proxy support. Do |
|---|
| 29 | # not set this to True if you are not using proxies as this would be a |
|---|
| 30 | # security risk. |
|---|
| 31 | BEHIND_PROXY = None |
|---|
| 32 | |
|---|
| 33 | # ---------------------------------------------------------------------------- |
|---|
| 34 | # here you can further configure the wsgi app settings but usually you don't |
|---|
| 35 | # have to touch them |
|---|
| 36 | import sys |
|---|
| 37 | import os |
|---|
| 38 | if ZINE_LIB not in sys.path: |
|---|
| 39 | sys.path.insert(0, ZINE_LIB) |
|---|
| 40 | |
|---|
| 41 | from zine import get_wsgi_app, override_environ_config |
|---|
| 42 | from flup.server.fcgi import WSGIServer |
|---|
| 43 | override_environ_config(POOL_SIZE, POOL_RECYCLE, POOL_TIMEOUT, BEHIND_PROXY) |
|---|
| 44 | application = get_wsgi_app(INSTANCE_FOLDER) |
|---|