Subdomain not included in the "?next=" for Django auth login?
I have a login required page at:
http://site1.example.com/widget/52312
If I email someone that link for them to click on, they get sent to the Login prompt. But after they login they end up going to http://example.com/widget/52312. How do you keep the subdomain in the site preserved when a user gets prompted through a login process?
NOTE: The 'site1' is specific to开发者_JS百科 the logged in user and not set for the whole machine in Apache. Each user has their own subdomain, but the links they are clicking on DO include their specific subdomain.
I think this probably happens for the same reasons as those given in answer to Django's HttpResponseRedirect seems to strip off my subdomain?
Make sure your web server has its servername set correctly (e.g. Apache ServerName
directive) i.e. set to site1.example.com
. If this is OK, see: http://thingsilearned.com/2009/01/05/using-subdomains-in-django/ - although I have a Django site with logins hosted on a subdomain working quite happily without the need for that middleware.
精彩评论