Skip to content

Instantly share code, notes, and snippets.

@voidlizard
Created December 11, 2009 17:47
Show Gist options
  • Select an option

  • Save voidlizard/254375 to your computer and use it in GitHub Desktop.

Select an option

Save voidlizard/254375 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from flup.server.fcgi_fork import WSGIServer
#import psyco
#psyco.full()
if __name__ == '__main__':
import sys, os
if not os.environ['TRACKER_HOME']:
raise Exception('$TRACKER_HOME variable not set')
sys.path.append(os.path.join(os.environ['TRACKER_HOME'],'lib'))
sys.path.append(os.path.join(os.environ['TRACKER_HOME'],'code'))
from project.application import create_application
from colubrid.debug import DebuggedApplication
from colubrid import execute
from config import configuration
import phenopy.memcached as memcached
import phenopy.sql.postgres as postgres
import psycopg2
app = create_application()
if len(sys.argv)>1 and sys.argv[1] == 'debug':
os.environ['TRACKER_PROFILE'] = 'dev'
conf = configuration(os.environ['TRACKER_PROFILE'])
memcached.settings.url = conf.memcached
debug = DebuggedApplication(app, True)
execute(debug, reload=True)
else:
WSGIServer(app).run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment