On Jul 7, 11:47 am, Oleg Lomaka <[email protected]> wrote: > Exactly for your case, you may set LOGIN_URL point to > '/myapp/accounts/login/', but 'next' parameter still left > inaccurate.http://docs.djangoproject.com/en/dev/ref/settings/#login-url
As far as I am concerned, Django should be inserting SCRIPT_NAME, ie., the mount point, automatically in front of the default value of LOGIN_URL and you shouldn't need to override it. In other words, it would make sense that partial URL paths in settings.py should always be relative to the mount point. But then, it may never have been logically right because of mod_python brokeness in the past with handling mount point. It would be nice if core developer could clear this issue up. > For more general case, to make working not only auth urls, look at those > snippets: > -http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango- comment > section, look around URL_PREFIX keyword; I would not pay too much attention to that comment with URL_PREFIX example. That is a very specialised case related, as far as I can tell, to a totally non standard configuration using VirtualDocumentRoot. I have never actually tried to work out what it does and the comment should probably be deleted so it doesn't cause confusion for the majority who should never need to fiddle stuff in a WSGI wrapper around Django entry point. > -http://opensourcemissions.wordpress.com/2010/03/12/finally-a-working-... I would also be careful about using example in that post as well. Again, normally you should never need to fiddle with SCRIPT_NAME and PATH_INFO. If you are you are likely using Django wrong. Using the mount point in urls.py is bad and using absolute paths in URLs rather than special function to create them relative to mount point in templates or code is also bad. Overall it shouldn't matter to the application itself if under runserver it appears at root of host rather than a sub URL. Graham > On Jul 7, 2010, at 3:12 AM, Jacob Fenwick wrote: > > > > > I'm deploying my Django app on Apache using mod_wsgi. > > > The app is using a non-root mount point. > > > So instead of accessing it as: > >http://server.com/ > > > I access it as: > >http://server.com/myapp/ > > > When I navigate to a url that requires logging in, I get redirected, but my > > mount point is dropped, e.g.: > >http://server.com/accounts/login/?next=/articledist/publish/ > > > But I should be redirected to: > >http://server.com/myapp/accounts/login/?next=/articledist/publish/ > > > If I manually navigate to the correct url it comes up. I'm even able to > > login correctly. > > However, this is obviously not an acceptable solution. > > > Why is this happening? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

