in Pinax, if I have a link that required login (i.e., I use the @login_required decorator), how do I redirect to that link after logging in, instead of being redirected to "what's next"???
Thanks
Simply set the LOGIN_REDIRECT_URL setting.
EDIT
It seems Pinax also supports another setting, LOGIN_REDIRECT_URLNAME, which seems to do the same thing as LOGIN_REDIRECT_URL, but is set to the url name, presumably so you don't have to make a call to reverse
in your settings.py file.
For more 'dynamic' redirects, the pinax.apps.account.views.login view uses pinax.apps.account.utils.get_default_redirect to look for a redirect URL from the following:
The code in get_default_redirect
actually is checking in the session for a 'redirect_to' key, which presumably holds one of the values defined in the settings, as the method makes no attempt to look at django.conf.session
on it's own. The docstring claims that it checks for those settings, however, and that seems to be what you are experiencing in your project.