Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6551285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:19:10+00:00 2026-05-25T12:19:10+00:00

My gae app serves multiple domains by if..else.. conditions rather than namespaces. I see

  • 0

My gae app serves multiple domains by if..else.. conditions rather than namespaces.
I see someone else solved it with namespaces

“I have a single app with multiple namespaces defined.

I’d like to set up multiple domains

a.com b.com c.com

and have the app detect the domain and write the domain’s data into
its respective namespace.”

I don’t know how to do it with namespaces and I want a better way to add a domain to the app for settings like content and languages. For example sending an email via a form then I use just a condition instead of namespace.

class FileUploadHandler(blobstore_handlers.BlobstoreUploadHandler):
  def post(self):
    adminemail = 'admin@domain1.com' if gethost() is 'domain1' else 'admin@domain2.com'
    message = mail.EmailMessage(sender=admin_email, subject=self.request.POST.get('subject'))
    message.body = ...
    message.to='info@domain...
    message.send()
    self.redirect('/customer_service.htm')

I use same workaround for queries, localization and in some cases even which template to render to while I should be able to make all domains able to be based on same templates and differ only by content so that my app doesn’t hard-code the domains and other settings that should be easy to add and change.

Are namespaces a great idea in this case? The way a managed the problem with different domains so far is a variable for the entity which domains it came from

if util.get_host().find('my-dot-com') > 0:
    url = 'www.my-dot-com.com'

I have a function that defines what I mean but it may confuse http://www.domain.com with domain.com or have problems with subdomains

def get_host():
  return os.environ.get("HTTP_HOST", os.environ["SERVER_NAME"])

I’d be glad to know any idea if you have, or if I’m mistaken and shouldn’t use namespaces in this case.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:19:11+00:00Added an answer on May 25, 2026 at 12:19 pm

    Yes, namespaces are ideally suited to what you’re doing. Simply store configuration data like admin emails in a per-domain configuration record, and store all the records for a given domain in a namespace named after that domain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm deploying an app to GAE. I have a single project setup in Eclipse,
I have a simple GAE app that includes a login/logout link. This app is
I am writing a small app that uses the GAE. I have parts of
I have a web app on GAE written in Go that performs some calculations
We have a small app with Restlet on the GAE server and GWT and
I'm developing GAE App. I have a favicon.ico in my static folder, as recommended
I have a GAE app that works just fine from my browser, but can't
I have a newly coded GWT/GAE app that uses RequestFactory and Editors on the
I am writing an app on GAE and I have a URL that will
My GAE app runs fine from my computer, but when I upload it, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.