Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (24 sloc) 1.13 KB
from google.appengine.api import lib_config
from google.appengine.api import users
# If using the default should_profile implementation, the profiler
# will only be enabled for requests made by the following GAE users.
enabled_profiler_emails = [
# Customize should_profile to return true whenever a request should be profiled.
# This function will be run once per request, so make sure its contents are fast.
class ProfilerConfigProduction:
def should_profile(environ):
user = users.get_current_user()
return user and in _config.ENABLED_PROFILER_EMAILS
class ProfilerConfigDevelopment:
def should_profile(environ):
return users.is_current_user_admin()
# see
_config = lib_config.register('gae_mini_profiler',
{'ENABLED_PROFILER_EMAILS': enabled_profiler_emails,
'ConfigProduction': ProfilerConfigProduction,
'ConfigDevelopment': ProfilerConfigDevelopment})