My problem: A user gets an email with qrcode, the qrcode links to a website. But when the user is not logged in he cant reach the linked site (because of the login requirement). I managed to redirect to the requested path after log in. However i want this to work also if the user is not registered yet, so user gets the qr link, but has to register first. Then after registration he will be redirected to the clicked url of the qr.
What i have for the redirection after login:
settings.py add the following code:
EMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
)
in base.html add the following code:
<a href="{% url "login" %}?next={{request.path}}" style="margin-left: 20px">Login</a>
How can i write the code so that after registration the user is directed to the requested url.