root / trunk / start-cogplanet.py

Revision 28, 0.8 kB (checked in by tim, 5 years ago)

easy_config can now be turned on/off by setting the easy_config.enabled
property in [dev|prod|test|app].cfg. Defaults to True

  • Property svn:executable set to *
  • Property svn:keywords set to LastChangedBy LastChangedRevision LastChangedDate HeadURL
Line 
1#!/usr/local/bin/python
2import pkg_resources
3pkg_resources.require("TurboGears")
4
5from turbogears import update_config, start_server
6import cherrypy
7cherrypy.lowercase_api = True
8from os.path import *
9import sys
10
11# first look on the command line for a desired config file,
12# if it's not on the command line, then
13# look for setup.py in this directory. If it's not there, this script is
14# probably installed
15if len(sys.argv) > 1:
16    update_config(configfile=sys.argv[1], 
17        modulename="cogplanet.config")
18elif exists(join(dirname(__file__), "setup.py")):
19    update_config(configfile="dev.cfg",modulename="cogplanet.config")
20else:
21    update_config(configfile="prod.cfg",modulename="cogplanet.config")
22
23import cogplanet.easy_config
24
25from cogplanet.controllers import PlanetController
26
27
28start_server(PlanetController())
Note: See TracBrowser for help on using the browser.