Forums

Set GoDaddy domain for existing PA Hacker account app

Hey, I was following the instructions (https://www.pythonanywhere.com/wiki/OwnDomains) to set up my newly purchased domain with an already existing app . However, with a PA hacker account I cannot set up a new web app without deleting the exisiting one and re-installing it. Is that necessary or is there another way?

What I have done in the past in that situation is create the new webapp www.mydomain.com and then copy the files from your original project over to the new. Something like:

cp -rf /home/meningo/oldproject/. /home/meningo/newproject/.

You'll have to modify a few things, but it's a small amount and should all be in your project folder (wsgi.py, settings.py, and sometimes urls.py).

Useful, thanks!

It's worth saying that if you delete a web app, we just take it offline and move the WSGI file that configures it to one side. So if you want to rename a web app without upgrading to an account type the allows two apps (which is perfectly reasonable!) then you can delete the existing one, create a new one using "Manual configuration" for the new domain, then copy the backed-up WSGI file from /var/www on top of the new one's.

The only downside is that you lose static file mapping.

All of which seems to suggest that we should support moving web apps from domain to domain! I'll get that onto our to-do list.

Much appreciated forward action Giles!

In the end I updated my account however, as I am not too comfortable in manual configurations. Still surprised though how long it takes for domain configuration to take effect (GoDaddy & Co announce 24h to 48h, but who'd believe it...?) - still waiting.

I guess the slow bit is the DNS propagation? It is slow, yes -- but it makes some kind of sense. Basically, there can be loads of machines around the world caching DNS settings -- that's why it's fast enough to be usable :-)

One thing you can do to make it faster next time you make a change is modify the "TTL" value. That's the "Time to Live", a number in seconds that tells caching DNS servers how long they should cache before they get the server's details again. A lower TTL means that changes propagate faster -- but it does mean that access to your site can be marginally slower, because (of course) stuff isn't cached so much.

A useful tool to track DNS propagation is What's my DNS. You enter the hostname into the first input, then select the record type from the second (you'll probably want "CNAME" for a PythonAnywhere web app) then hit the "Search" button, and it'll tell you what values it gets from a bunch of locations around the world.

[edit] We've found 300 seconds to be a good TTL value.