By Neil McEvoy
I have set up a single click droplet with Django. Access works properly using the ip address (138.197.137.142) but not the newly assigned domain name (www.rxitsurvey.com).
Although the debugging information provided by Django suggests the site name be added to the ALLOWED HOSTS in the settings.py file, that file uses the ipaddresses() function to determine the hosts at run time.
As a fix I have tried this: I added the domain names to the nginx configuration file (copied the original /sites-available/django file as /sites-available/django_1 and linked this file to the /sites-enabled folder (removed the django file in this folder). This did not correct the problem.
How do I fix this?
Thanks.
n.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hey friend,
Try changing the ALLOWED_HOSTS value from the ip _ addresses (removed spaces for markdown) function to that of your domain. If you’re defining that at the top of the file and then it’s being redefined by the function later, you can change the later instance of it to this:
ALLOWED_HOSTS += ip_addresses()
Hope that helps :)
Jarland
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.