Exemplo n.º 1
0
def _CheckIsDevServer():
  if not utils.IsDevelopmentServer():
    raise base_handler.Error(500, 'testbackend is only accessible in DEV')
Exemplo n.º 2
0
def GetLoginUrl(url):
    """Gets a URL that accepts a sign-in and then proceeds to the given URL."""
    if utils.IsDevelopmentServer():
        root_path = config.Get('root_path') or ''
        return root_path + '/.login?redirect=' + urllib.quote(url)
    return gae_users.create_login_url(url)
Exemplo n.º 3
0
def GetLogoutUrl(url):
    """Gets a URL that signs the user out and then proceeds to the given URL."""
    if utils.IsDevelopmentServer():
        root_path = config.Get('root_path') or ''
        return root_path + '/.login?logout=1&redirect=' + urllib.quote(url)
    return gae_users.create_logout_url(url)
Exemplo n.º 4
0
def IsDeveloper():
    """Returns True if running in development or the user is an app admin."""
    return utils.IsDevelopmentServer() or gae_users.is_current_user_admin()