okfn/bibserver — Issue #197: WSGI Instructions
Author: MarioLipinski
Created: 2012-03-09 03:35:50+00:00
State: open

I am wondering why now WSGI file / instructions are shipped with bibserver. I use the following code for this now:

```
virtualenv_dir = '../virtualenv'

import sys
from os.path import dirname, abspath
bibserver_dir = abspath(dirname(abspath(__file__) + '/../'))
try:
if virtualenv_dir[0] == '/':
activate_this = abspath(virtualenv_dir + '/bin/activate_this.py')
else:
activate_this = abspath(bibserver_dir + '/' + virtualenv_dir + '/bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
except NameError:
virtualenv_dir = None
sys.path.insert(0, abspath(bibserver_dir))
from bibserver.web import app as application
application.debug = True
```