Skip to content

Instantly share code, notes, and snippets.

@revolunet
Created January 3, 2012 13:25
Show Gist options
  • Save revolunet/1554877 to your computer and use it in GitHub Desktop.
Save revolunet/1554877 to your computer and use it in GitHub Desktop.
sample flask+apache2+wsgi setup
<VirtualHost *:80>
ServerName flask.revolunet.com
WSGIScriptAlias / /home/git/flask_app/run.wsgi
WSGIScriptReloading On
<Directory /home/git/flask_app>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
#!/usr/bin/python
import os
import sys
# virtualenv activation if any
activate_this = '/home/envs/supaenv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, PROJECT_ROOT)
from myapp import app as application
@jmswen
Copy link

jmswen commented Apr 17, 2012

Thank you!! Super helpful, especially the sys.path.insert line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment