Forums

Two web pages on Pythonanywhere domain

Hi, I have just upgraded my plan to multiple apps, as i want to hold two different web apps. Do I have to also buy domains somewhere, if I do not want to have 'custom' names, just have the apps as subdomains on my login.pythonanywhere.com domain (like: app1.login.pythonanywhere.com and app2.login.pythonanywhere.com)? If no, how to do this?

Paying customers can create domains like <somestring>-<username>.pythonanywhere.com

Could you please advise step-by-step how can I do it? (I am paying customer.)

  1. Create a web app
  2. When you're asked for a name enter one of the form <somestring>-<username>.pythonanywhere.com into the custom domain name text field.

OMG, it actually works. It is not clear, though. I tried to create subdomain somestring.username.pythonanywhere.com and was receiving error: "The only .pythonanywhere.com address you can register is rszydlik.pythonanywhere.com", which gave me no clue it was ok just to change dot into dash. Please note it may be useful to clarify this for greenhorns like me. :)

Yes, absolutely! The UI for supporting these multiple subdomains is a bit of a mess, and we know we need to sort it out :-)

To confirm, I ran into this too. I developed a first app at <app1name>.<pythonanywhere>.<com>. That is, I made my username the app name, since that seemed a more descriptive thing to share with others. Within that first app, I then developed a second app, piggybacking on the infrastructure of the first, until I eventually realized it warranted being separated off as its own thing. So then I upgraded to two apps, and it took me a while to realize that naming the second app <app2name>-<app1name>.<pythonanywhere>.<com> was ok but naming it <app1name>-<app2name>.<pythonanywhere>.<com> is not.

For context, the pressing need that made me figure this out was that I wanted both apps to have home pages without anything after ".com" (i.e. index() functions with path "/"). Now that I am following the <somestring>-<username> convention, it does work for both apps. The final step for me is now using two custom domains, where <customname1>.<customdomain> replaces <app1name>.<pythonanywhere>.<com> and <customname2>.<customdomain> replaces <app2name>-<app1name>.pythonanywhere.com. And it works great!

Excellent! Glad you could get everything working.