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


i'm trying pass 'next' field login.html template via urls.py file using code

this works fine:

urls((r'^login/$', 'django.contrib.auth.views.login',     {'template_name': 'myapp/login.html'}), 

but don't want redirect after login go '/accounts/profile/' page, want go site root, '/'.

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

but get

login() got unexpected keyword argument 'next' 

not sure how pass 'next' argument via urls function , can't seem find other solutions, advice?

i able this,

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

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -