[Fixed]-Going to www version of site url receives 404 on django site

1👍

Change ALLOWED_HOSTS in the settings.py to something like this

ALLOWED_HOSTS = [‘www.example.com’, ‘example.com’]

According to Django Documentation, ALLOWED_HOSTS defines

A list of strings representing the host/domain names that this Django site can serve. This is a security measure to prevent an attacker from poisoning caches and triggering password reset emails with links to malicious hosts by submitting requests with a fake HTTP Host header, which is possible even under many seemingly-safe web server configurations.

For more ALLOWED_HOSTS

Leave a comment