Forums

Access to application without changing CName

I am in the process of moving 2 existing production servers to PythonAnywhere. The first I have set up as *.pythonanywhere.com. This is going through testing and is almost ready to copy to the correct domain name. The second application I have set up using its subdomain. Obviously, until it is working correctly I cannot change the CName to point to this. How do I access the application to test it? Can I access it via an IP address?

Hi there,

as a temporary hack, you could edit your hosts file to add an entry for

www.yourdomain.com  50.19.109.98

And then you'd be able to view the webapp as hosted by pythonanywhere. That would only work from the PC you'd hacked the hosts file on, and it will only work while we keep using the 50.19... IP address, which we don't guarantee we'll do forever...

50.19.109.98 www.yourdomain.com

works, but makes it difficult to compare the old site to the new one unless you happen to have a spare computer lying around.
Can you add a better way of doing this to your list of "nice to haves"?

There's really not anything we can do for this. You're essentially asking for your machine to be on 2 different internets - the real one where www.yourdomain.com goes to your old site and an imaginary one where www.yourdomain.com goes to the site on PythonAnywhere. The suggestion that harry gave tricks your computer into thinking it's on the imaginary internet.

If you need to compare sites side-by-side, your best bet is to use a VM. That's what we do at PythonAnywhere when we want to view our development clusters without losing our ability to view the real PythonAnywhere.