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

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 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 now

webapp_django_version = '1.2'

The hyperlink towards the namespace-aware which i do not understand is

I believe the appropriate code is:


    title = os.environ['SERVER_NAME']


    title = namespace_manager.google_applications_namespace()


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

    if snacks:

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