Search code examples
djangodnsdjango-subdomains

Adding a domain to a django webapp running on digital ocean


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


Solution

    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!