Hi Jurgen,
A slightly long answer for you, but I figured it was best to explain things properly rather than just give you the tl;dr version :-) But in case you just want the short version -- we only support web apps on your own custom domains and on yourusername.pythonanywhere.com
. www.
yourusername.pythonanywhere.com
is not supported.
OK, here's the details:
The ALLOWED_HOSTS
Django setting just tells it that it's OK if it receives requests for those sites. The only thing you should have in there for a site at jurgenizer.pythonanywhere.com
is jurgenizer.pythonanywhere.com
. The only way in which it's connected to the host names that are used to access your site is that those host names must appear in it. So, if X is a hostname for your site, it must appear in there, but X being in there doesn't make it a hostname for your site.
Routing requests to your web app is done by a combination of DNS and the web apps you have set up on the "Web" tab. If you had a domain www.something.com
registered with a domain name registrar, you'd set up a web app on the "Web" tab called "www.something.com". This would give you an identifier of a part of PythonAnywhere (something like webapp-1234.pythonanywhere.com
), and you'd then go to your registrar and set up some DNS settings to say that www.something.com
has a "CNAME" pointing that address to webapp-1234.pythonanywhere.com
. So requests to www.something.com
would go to the appropriate part of PythonAnywhere, which would recognise them as belonging to a particular web app, and process them using the code for that web app.
Of course, in this case, you don't own the pythonanywhere.com
domain, so all of the DNS stuff has already been done by us. Basically we've set it up so that yourusername`.pythonanywhere.com always goes to the appropriate part of PythonAnywhere for that user's web apps.
But we haven't done the equivalent DNS setup for www.
yourusername.pythonanywhere.com
.
Does that make things a bit clearer?