With this code: urls.py
url(r'^login/',
"django.contrib.auth.views.login"),
and tamplate like that:
<a href="{% url django.contrib.auth.views.login %}?next={{request.path}}">Login</a>
which is redirecting to page with this code:
{% if not user.is_authenticated %}
<form method="post" action="">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Zaloguj" />
<input type="hidden" name="next" value="" />
</form>
{% else %}
<h1>Już jestes zalogowany chujku</h1>
{% endif %}
I have context processor 'django.core.context_processors.request' but after login in I am redirected to
accounts/profile/
When I am on login page url is: /accounts/login/?next=/gallery/newest/. More, after login in it loged me in but I am still in /accounts/login/?next=/gallery/newest/1/.
Have I bugs in this code or answer is laying somewhere else?