I am using Django's built in login view as can be seen in the following snippets:
urls.py
url(r'^login$',login,{'template_name': 'login.html'},name="login"),
template.html
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<table>
<tr>
<td>{{ form.username.label_tag }}</td>
<td>{{ form.username }}</td>
</tr>
<tr>
<td>{{ form.password.label_tag }}</td>
<td>{{ form.password }}</td>
</tr>
</table>
<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
How can I use the next variable to redirect to a URL different than the default /accounts/profile/ that django redirects to? I know of people referring to the settings.py file but I am wondering how I can utilize the next variable to do this?
(I'm not really sure of how the next variable works even after referring to documentation, an explanation of this would be much appreciated)