Added appropriate environment configuration for various deploy methods

This commit is contained in:
Seth House 2013-08-28 23:37:40 -06:00
parent fa2746b714
commit 4dd9e97d7f
2 changed files with 4 additions and 0 deletions

View File

@ -1124,6 +1124,9 @@ class API(object):
},
}
if self.apiopts.get('debug', False) == False:
conf['global']['environment'] = 'production'
# Serve static media if the directory has been set in the configuration
if 'static' in self.apiopts:
conf[self.apiopts.get('static_path', '/static')] = {

View File

@ -65,6 +65,7 @@ def get_application(*args):
def wsgi_app(environ, start_response):
root, _, conf = opts_tuple or bootstrap_app()
cherrypy.config.update({'environment': 'embedded'})
cherrypy.tree.mount(root, '/', conf)
return cherrypy.tree(environ, start_response)