Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a1be583a1d
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (32 sloc) 1.288 kb
import os
import sys
import logging
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
# Add lib as primary libraries directory, with fallback to lib/dist
# and optionally to lib/, loaded using zipimport.
lib_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'lib')
if lib_path not in sys.path:
sys.path[0:0] = [
# 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 simple import app
def enable_appstats(app):
"""Enables appstats middleware."""
from google.appengine.ext.appstats.recording import \
app.wsgi_app = appstats_wsgi_middleware(app.wsgi_app)
def enable_jinja2_debugging():
"""Enables blacklisted modules that help Jinja2 debugging."""
from import HardenedModulesHook
HardenedModulesHook._WHITE_LIST_C_MODULES += ['_ctypes', 'gestalt']
admin_app = admin.application
if app.config['DEBUG']:
app = get_debugged_app(app)
Jump to Line
Something went wrong with that request. Please try again.