Created
April 22, 2014 00:42
-
-
Save chan-lee/11161579 to your computer and use it in GitHub Desktop.
using namespace 'test' in app engine when it runs by dev server or is called with subdomain 'test.'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
from google.appengine.api import namespace_manager | |
def namespace_manager_default_namespace_for_request(): | |
if 'test' in os.environ['SERVER_NAME'] or 'Dev' in os.environ['SERVER_SOFTWARE']: | |
return 'test' | |
return namespace_manager.google_apps_namespace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment