Hi, I am a novice. I have installed django from the 1 click marketplace. I am getting the response from the ip url. Have added domain name and no problem ssh to the server. I have edited the settings and added the domain name but still getting: Invalid HTTP_HOST header: ‘www.mydomain.com’. You may need to add ‘www.mydomain.com’ to ALLOWED_HOSTS
Below is the setting.py:
def ip_addresses(): ip_list = ['18.104.22.168', '2400:6180:0:d0::fb9:8001'] for interface in netifaces.interfaces(): addrs = netifaces.ifaddresses(interface) for x in (netifaces.AF_INET, netifaces.AF_INET6): if x in addrs: ip_list.append(addrs[x]['addr']) return ip_list ALLOWED_HOSTS = ip_addresses('www.mydomain.com')
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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!