Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

My view

def login(request):
    c = {}
    c.update(csrf(request))
    return render_to_response(request,
'login.html', c)

def auth_view(request):
    username = request.POST.get
('username', '')
    password = request.POST.get
('password', '')
    user = auth.authenticate
(username = username, password =
password)
    if user is not None:
       auth.login(request,user)
        if request.method == 'POST':
            return HttpResponseRedirect('accounts/loggedin/')
        else:
             Retun HttpResponseRedirect('accounts/invalid/') 

Error occurs that function auth_view is returning nothing.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
228 views
Welcome To Ask or Share your Answers For Others

1 Answer

If the user is None, auth_view doesn't return anything. You must return an HttpResponse...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...