Django-allauth: How To Modify Email Confirmation Url?
I'm running django on port 8001, while nginx is handling webserver duties on port 80. nginx proxies views and some REST api calls to Django. I'm using django-allauth for user reg
Solution 1:
Django get hostname and port from HTTP headers.
Add proxy_set_header Host $http_host;
into your nginx configuration before options proxy_pass
.
Solution 2:
I had the same problem, and also found that ferrangb's solution had no effect on outgoing allauth emails. mr_tron's answer got me halfway, but I had to do a little bit more:
1) In nginx configuration, put
proxy_set_header Host $http_host
before options proxy_pass.
2) In settings.py
, add the domain name to ALLOWED_HOSTS
. I also added the www version of my domain name, since I get traffic to both addresses.
ALLOWED_HOSTS = ['127.0.0.1', 'example.com', 'www.example.com']
And, of course, restart nginx and gunicorn or whatever is serving your Django. With the first step but not the second, all hits to the site were instant 400 errors (unless DEBUG = True
in settings.py
.)
Post a Comment for "Django-allauth: How To Modify Email Confirmation Url?"