Passing 'next' to django login template via urls.py

django, django-urls

Solution

I was able to do this,

url(r'^login/$', 'django.contrib.auth.views.login',
    {'template_name': 'login.html', 'extra_context': {'next':'/'}}),

Problem

I'm trying to pass the 'next' field to my login.html template via the urls.py file using this code This works fine: ``` urls((r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'myapp/login.html'}), ``` But I don't want my redirect after login to go to the '/accounts/profile/' page, I want to go to the site root, '/'. ``` url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html', 'next':'/'}), ``` but I get ``` login() got an unexpected keyword argument 'next' ``` Not sure how to pass the 'next' argument via the urls function and can't seem to find other solutions, any advice?

Original source