Are you able to assist me to solve an easy problem to ensure that I'm able to learn to solve a far more advanced? I wish to learn to add and employ namespaces to my application and something use, please correct me if I am mistaken, is for instance which picture to show based on current namepsace. Now I would like a flexible to become for example logo design_us dot_com.presen if current namespace is .com and logo design_us dot_com_us dot_br.presen if current namespace is really a .com.br

I'm able to already accomplish this "for the user"

def get_host():

    return os.environ.get("HTTP_HOST", os.environ["SERVER_Title"])

however i think an answer with namespaces may be the more pythonic? I checked out the guestbook example that utilizes namespaces, added some code to my appengine_config.py which resulted for the reason that I could not display object since my objects were from another namespace and so i needed to take it off. Now I wish to get began again correctly or being able to introduce namespaces having to break any material. Might help or should i find more information and get more information?

Thank you for any advice

The related question where I already requested relating to this is Can namespaces enable multiple domain names? where the reply is good and acceptable however i really did not find any code to obtain me began having to break my "default" empty(?) namespace.

Update: Here's my appengine_config.py now

webapp_django_version = '1.2'

The hyperlink towards the namespace-aware appengine_config.py which i do not understand is http://google-application-engine-samples.googlecode.com/svn/trunk/guestbook_namespaces/appengine_config.py

I believe the appropriate code is:

  if _NAMESPACE_PICKER == _USE_SERVER_Title:

    title = os.environ['SERVER_NAME']

  elif _NAMESPACE_PICKER == _USE_GOOGLE_Applications_DOMAIN:

    title = namespace_manager.google_applications_namespace()

  elif _NAMESPACE_PICKER == _USE_COOKIE:

    snacks = os.environ.get('HTTP_COOKIE', None)

    if snacks:

      title = Cookie.BaseCookie(snacks).get('namespace')