Skip to content

Instantly share code, notes, and snippets.

@jmaupetit
Last active December 14, 2015 10:18
Show Gist options
  • Save jmaupetit/5070624 to your computer and use it in GitHub Desktop.
Save jmaupetit/5070624 to your computer and use it in GitHub Desktop.
#!/usr/bin/eval PYTHON_VERSION=2.6 PYTHONPATH=/your/python/path/ python
import os
import sys
_PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, _PROJECT_DIR)
sys.path.insert(0, os.path.dirname(_PROJECT_DIR))
_PROJECT_NAME = _PROJECT_DIR.split('/')[-1]
os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % _PROJECT_NAME
# django-configuration requirements
os.environ['DJANGO_CONFIGURATION'] = 'Prod' # Your configuration here
from configurations import importer
importer.install()
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment