mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-05 12:41:49 +02:00

ihatemoney.wsgi is the entry point for mod_wsgi. A virtualenv can be activated if its path is specified as an env var in the apache virtual host file
14 lines
605 B
Python
14 lines
605 B
Python
import sys
|
|
import os
|
|
|
|
__HERE__ = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
# Wrapper around application to get the env var set by Apache
|
|
def application(environ, start_response):
|
|
if environ.get('IHATEMONEY_VENV_PATH'):
|
|
activate_this = os.path.join(environ.get('IHATEMONEY_VENV_PATH'), 'bin/activate_this.py')
|
|
execfile(activate_this, dict(__file__=activate_this))
|
|
# Add the budget directory to the path so we can then import from run
|
|
sys.path.insert(0, os.path.join(__HERE__, 'budget'))
|
|
from run import app as _application
|
|
return _application(environ, start_response)
|