Esempio n. 1
0
def main():
    app = create_app()
    # If we're on the local server, let's enable Flask debugging.
    if 'SERVER_SOFTWARE' in os.environ and os.environ['SERVER_SOFTWARE'].startswith('Dev'):
        app.debug = False
        app = get_debugged_app(app)
    CGIHandler().run(app)
Esempio n. 2
0
def main():
    app = create_app()
    # If we're on the local server, let's enable Flask debugging.
    # For more information: http://goo.gl/RNofH
    if 'SERVER_SOFTWARE' in os.environ and os.environ['SERVER_SOFTWARE'].startswith('Dev'):
        app.debug = True
        app = get_debugged_app(app)
    CGIHandler().run(app)
Esempio n. 3
0
def main():
    app = create_app()
    # If we're on the local server, let's enable Flask debugging.
    # For more information: http://goo.gl/RNofH
    if 'SERVER_SOFTWARE' in os.environ and os.environ[
            'SERVER_SOFTWARE'].startswith('Dev'):
        app.debug = True
        app = get_debugged_app(app)
    CGIHandler().run(app)
Esempio n. 4
0
def main():
    if DEBUG_MODE:
        # Run debugged app
        from werkzeug_debugger_appengine import get_debugged_app
        app.debug = True
        debugged_app = get_debugged_app(app)
        CGIHandler().run(debugged_app)
    else:
        # Run production app
        from google.appengine.ext.webapp.util import run_wsgi_app
        run_wsgi_app(app)
Esempio n. 5
0
def main():
    if DEBUG:
        # Run debugged app
        from werkzeug_debugger_appengine import get_debugged_app
        from wsgiref.handlers import CGIHandler
        app.debug=True
        debugged_app = get_debugged_app(app)
        CGIHandler().run(debugged_app)
    else:
        from google.appengine.ext.webapp.util import run_wsgi_app
        run_wsgi_app(app)
Esempio n. 6
0
def main():
    if DEBUG_MODE:
        # Run debugged app
        from werkzeug_debugger_appengine import get_debugged_app
        app.debug=True
        debugged_app = get_debugged_app(app)
        CGIHandler().run(debugged_app)
    else:
        # Run production app
        from google.appengine.ext.webapp.util import run_wsgi_app
        run_wsgi_app(app)
Esempio n. 7
0
def main():
    app = create_app()
    csrf(app)
    # If we're on the local server, let's enable Flask debugging.
    # For more information: http://goo.gl/RNofH
    if settings.debug:
        app.debug = True
        app = get_debugged_app(app)
        settings.debug_profiler_enabled = profiler_config.should_profile(app)
    app = profiler.ProfilerWSGIMiddleware(app)
    CGIHandler().run(app)
Esempio n. 8
0
def real_main():

    wsgi_app = request_cache.RequestCacheMiddleware(api_app)
    wsgi_app = profiler.ProfilerWSGIMiddleware(wsgi_app)
    wsgi_app = middleware.GAEBingoWSGIMiddleware(wsgi_app)

    if App.is_dev_server:
        try:
            # Run debugged app
            from werkzeug_debugger_appengine import get_debugged_app
            api_app.debug = True
            debugged_app = get_debugged_app(wsgi_app)
            CGIHandler().run(debugged_app)
            return
        except Exception, e:
            api_app.debug = False
            logging.warning("Error running debugging version of werkzeug app, running production version: %s" % e)
Esempio n. 9
0
def real_main():

    wsgi_app = request_cache.RequestCacheMiddleware(api_app)
    wsgi_app = profiler.ProfilerWSGIMiddleware(wsgi_app)
    wsgi_app = middleware.GAEBingoWSGIMiddleware(wsgi_app)

    if App.is_dev_server:
        try:
            # Run debugged app
            from werkzeug_debugger_appengine import get_debugged_app
            api_app.debug = True
            debugged_app = get_debugged_app(wsgi_app)
            CGIHandler().run(debugged_app)
            return debugged_app
        except Exception, e:
            api_app.debug = False
            logging.warning(
                "Error running debugging version of werkzeug app, running production version: %s"
                % e)
Esempio n. 10
0
lib_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'lib')
if lib_path not in sys.path:
    sys.path[0:0] = [
        lib_path,
    ]

# Append zip archives to path for zipimport
for filename in os.listdir(lib_path):
    if filename.endswith((".zip", ".egg")):
        sys.path.insert(0, "%s/%s" % (lib_path, filename))


from google.appengine.ext import admin
from werkzeug_debugger_appengine import get_debugged_app

from api import app


def enable_appstats(app):
    """Enables appstats middleware."""
    from google.appengine.ext.appstats.recording import \
        appstats_wsgi_middleware
    app.wsgi_app = appstats_wsgi_middleware(app.wsgi_app)


admin_app = admin.application

#enable_appstats(app)
if app.config['DEBUG']:
    app = get_debugged_app(app)
Esempio n. 11
0
import sys, os
from google.appengine.ext.appstats import recording

# package_dir = "gae-env"
# package_dir = "gae-env/lib/python2.7/site-packages"
package_dir = 'libs'
package_dir_path = os.path.join(os.path.dirname(__file__), package_dir)

# Allow unzipped packages to be imported
# from packages folder
sys.path.insert(0, package_dir_path)

# Append zip archives to path for zipimport
for filename in os.listdir(package_dir_path):
    if filename.endswith((".zip", ".egg", ".tar.gz")):
        sys.path.insert(0, "%s/%s" % (package_dir_path, filename))

from motorrijweer import app

# Check for Google appengine signature
if os.environ['SERVER_SOFTWARE'].startswith('Development'):
    from werkzeug_debugger_appengine import get_debugged_app
    app = get_debugged_app(app)

app = recording.appstats_wsgi_middleware(app)
Esempio n. 12
0
        # The rest is optional.
        # stats.print_callees()
        stats.print_callers()
        print "</pre>"


application = request_cache.RequestCacheMiddleware(api_app)
application = profiler.ProfilerWSGIMiddleware(application)
application = middleware.GAEBingoWSGIMiddleware(application)

if App.is_dev_server:
    try:
        # Run debugged app
        from werkzeug_debugger_appengine import get_debugged_app
        api_app.debug = True
        application = get_debugged_app(application)
    except Exception, e:
        api_app.debug = False
        logging.warning("Error running debugging version of werkzeug app, running production version: %s" % e)
    
# Uncomment the following line to enable profiling 
#application = ProfilerMiddleware(application)

def main():
    run_wsgi_app(application)

# Use App Engine app caching
if __name__ == "__main__":
    main()

Esempio n. 13
0
# -*- coding: utf-8 -*-
"""
AppEngine bootstrap for ae_image_app.

"""

import sys
import os
sys.path[1:1] = [os.path.abspath(os.path.dirname(__file__) + '/lib')]

from ae_image_app import app
from wsgiref.handlers import CGIHandler


if __name__ == '__main__':
    if os.environ.get('SERVER_SOFTWARE', '').startswith('Dev'):
        import werkzeug_debugger_appengine
        app.debug = True
        app = werkzeug_debugger_appengine.get_debugged_app(app)
    CGIHandler().run(app)
Esempio n. 14
0
        # The rest is optional.
        # stats.print_callees()
        stats.print_callers()
        print "</pre>"


application = request_cache.RequestCacheMiddleware(api_app)
application = profiler.ProfilerWSGIMiddleware(application)
application = middleware.GAEBingoWSGIMiddleware(application)

if App.is_dev_server:
    try:
        # Run debugged app
        from werkzeug_debugger_appengine import get_debugged_app
        api_app.debug = True
        application = get_debugged_app(application)
    except Exception, e:
        api_app.debug = False
        logging.warning(
            "Error running debugging version of werkzeug app, running production version: %s"
            % e)

# Uncomment the following line to enable profiling
#application = ProfilerMiddleware(application)


def main():
    run_wsgi_app(application)


# Use App Engine app caching