0๐
โ
I got this worked out later time. The issue was due to PREPEND_WWW django setting. With this option on, DNS was not resolved because it keeps going to www.stage.xxx.xxx first before it is resolved by DNS.
๐คImju
1๐
If nginx / gunicorn generally you can run on 127.0.0.1 since nginx is a reverse proxy.
# settings.py
ALLOWED_HOSTS = ['127.0.0.1']
Nginx conf in sites-available / sites-enabled
server {
server_name example.com;
access_log off;
location /static/ {
alias /var/www/django-path-to-static-root;
}
location / {
proxy_pass http://127.0.0.1:8001;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}
}
gunicorn
gunicorn something.wsgi --bind 127.0.0.1:8001
๐คMikeec3
- [Answer]-How to run Django views from a script?
- [Answer]-JQuery 1.11.3: Insert a div of "Tasks" based on the order of their categories
- [Answer]-How to write helper method for PATCH request using django-tastypie?
- [Answer]-Why do we need fields value in Meta class in Django forms?
Source:stackexchange.com