python - Django login - missing 1 required positional argument -
i have simple login view:
def logowanie(request): if request.method == 'post': user = authenticate( username=request.post.get('id_username', '').strip(), password= request.post.get('id_password', ''), ) if user none: messages.error(request, u'invalid credentblog.ials') else: if user.is_active: login(request, user) return httpresponseredirect(request.get.get('next', '/')) else: messages.error(request, u'user not active.') return render_to_response('registration/login.html', locals(), context_instance=requestcontext(request))
when try go login page, error:
typeerror: login() missing 1 required positional argument: 'user'
what doing wrong?
i have got same error. file urls.py has route
url(r'^login', navigoweb_views.login, name='log'),
i changed to:
url(r'^log', navigoweb_views.log, name='log'),
check route.
Comments
Post a Comment