after two days From deplyoing my application and working fine, I have decided to change the name of the subdomain so i have just rename it under the path:
/etc/nginx/sites-available
and then i have did again
sudo certbot --nginx
for the "https" ,
then adding this host in settings.py from my django application,
I have did sudo systemctl restart nginx
to restart nginx
then:
sudo systemctl restart gunicorn
then
python manage.py makemigrations
-->No changes detected
python manage.py migrate
-->No changes detected
and when i go to the browser to access to my application I got this error
DisallowedHost at /
Invalid HTTP_HOST header: 'subdomain.domain.com'. You may need to add 'subdomain.domain.com' to ALLOWED_HOSTS.
, otherwise i Have added the host on "settings.py"
Help please isn't there any other step i should do when i change the host ,Thanks in advance
You have not showed what you have inside your Django settings.py
file, but I assume you have not configured the ALLOWED_HOSTS
variable as you should have. This is how it should look like:
ALLOWED_HOSTS = [
'subdomain.domain.com'
]
Also, make sure to restart the HTTP server. The settings file is loaded to memory, so if you make changes to it, you need to restart the server.
systemctl restart gunicorn