-1

I have a Django Web App that is currently live on digital ocean with an IP address say w.x.y.z, I have also bought a domain name say example.com, how can i add this to my app so that, when i go to example.com , I get to my website which currently is only accessible through the IP. Any advice is appreciated. I'm new to this

user6714507
  • 63
  • 1
  • 9
  • 1
    THis is not a setting in Django, you will need to edit the DNS record of the domain you have bought. For example a manual for hover: https://help.hover.com/hc/en-us/articles/217282457-How-to-Edit-DNS-records-A-AAAA-CNAME-MX-TXT-SRV- – Willem Van Onsem Aug 30 '18 at 08:06

1 Answers1

0
  1. Buy/Register your Domain Name with Domain Name providers.
  2. You need to mention your IP in your DNS Management side at Domain Name service providers.

At Django Side - you just make sure to add your Domain Name into settings.py file, in ALLOWED_HOSTS

And you are done!

Sopan
  • 644
  • 7
  • 13
  • do you know if I have to edit something in the nginx settings? – user6714507 Sep 20 '18 at 07:59
  • Yes. So digital ocean serves Django via Ngnix :) check the documentation at - https://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html Here also - you need to tell Ngnix what Domain Name you are service via what IP. – Sopan Sep 20 '18 at 10:26
  • Before everything - check Digital ocean, they must have documented procedure to handle this case. You may need to skip modification of `settings.py`. – Sopan Sep 20 '18 at 10:28