Skip to content

Instantly share code, notes, and snippets.

@luisfredgs
Forked from LeZuse/wsgi.py
Created March 10, 2016 02:10
Show Gist options
  • Save luisfredgs/a95f13d0a8be8a669588 to your computer and use it in GitHub Desktop.
Save luisfredgs/a95f13d0a8be8a669588 to your computer and use it in GitHub Desktop.
WSGI script with virtualenv activation with Flask
import os
import sys
# Install venv by `virtualenv --distribute venv`
# Then install depedencies: `source venv/bin/active`
# `pip install -r requirements.txt`
activate_this = '/var/www/apache/csshat.com/csshat.com/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
path = os.path.join(os.path.dirname(__file__), os.pardir)
if path not in sys.path:
sys.path.append(path)
# The application object is used by any WSGI server configured to use this
# file.
# Ensure there is an app.py script in the current folder
from app import app as application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment