PythonAnywhere Forums

Setting up a custom domain via Google Domains

I purchase a domain from Google Domains on July 8. My purchased domain has no subdomain (www) in front, but I adjust the setting so Google will redirect the user to correct destination URL whether they enter the “www” or not. However, I still get the “Coming Soon” page approximately a week later. Is there anything wrong with my setting?

Below is my setting on Google Domains:

Subdomain forward

fundamentaltrader.net → http://webapp-xxxx.pythonanywhere.com Temporary redirect (302), Do not forward path

Subdomain forward

www.fundamentaltrader.net → http://webapp-xxxx.pythonanywhere.com Temporary redirect (302), Do not forward path

Hi there,

You should setup a forward from fundamentaltrader.net to www.fundamentaltrader.net, and then setup a cname record (not forward) that points from www.fundamentaltrader.net to webapp-xxxx.pythonanywhere.com

Hi Conrad, Do I set it up like this? I tried all combination of redirect and forward/not forward path for the "Subdomain forward", but It still doesn't work

Subdomain forward

fundamentaltrader.net → http://www.fundamentaltrader.net Temporary redirect (302), Forward path

Subdomain forward

www.fundamentaltrader.net → http://webapp-xxxxx.pythonanywhere.com Temporary redirect (302), Do not forward path

The first one is correct. This is incorrect: www.fundamentaltrader.net → http://webapp-xxxxx.pythonanywhere.com Temporary redirect (302), Do not forward path

Your webapp is not directly hosted at http://webapp-xxxxx.pythonanywhere.com. It is just a server that serves the website from the given domain. You have to set the CNAME to http://webapp-xxxxx.pythonanywhere.com and not redirects.

These pages may help: https://support.google.com/domains/answer/3251147 https://support.google.com/domains/answer/3290350

Thank you EndenDragon, I remove the 2nd "Subdomain forward" and added the "Custom resource records" with the following config:

NAME: www

TYPE: CNAME

TTL: 1h

DATA: webapp-xxxxxx.pythonanywhere.com.

I reloaded my page, but now all I see is "Bad Request (400)". I added "www" in front of my domain name.

For the bad request, check your Pythonanywhere error logs and see if there is any typo in the code.

Ok, I changed Debug to True in my Django "settings" file, now my site is loading correctly, but is there going to be any security concern if I did that? Or is this just the way it's supposed to set up?

you should not set debug = true. instead you should look at what the error was and try to fix it (if it is saying you need to add stuff to allowed_hosts etc, then you should do that instead)

Thank you conrad, I added 'www.fundamentaltrader.net' to the list of allowed_hosts, and everything is working now:)