메신저 정확히 받고 .. 실제로 httpresponse 리디렉션 아무것도 표시하지 않습니다. 실제로 http://127.0.0.1:8000/login/에 내 로그인 페이지가 표시됩니다. 이제 올바른 로그인을 원하면 내 인덱스 페이지로 리디렉션됩니다. 정확한 방법은 없습니다.성공 로그인 django 페이지 리디렉션
def login(request):
template = "../templates/admin/login.html"
data = {
}
user = auth.authenticate(username='aa', password='bb')
if user is not None and user.is_active:
template = "../templates/admin/index.html"
auth.login(request, user)
return HttpResponseRedirect("/login/index/")
return render_to_response(template, data,
context_instance = RequestContext(request))
thanx.
http://docs.djangoproject.com/en/1.3/topics/auth/#django.contrib.auth.login –
이 바로 내 보이는 (들여 쓰기를 가정하면 버전에 정확). 그건 파이썬 오류를 던지거나, 무엇이든지 상관없이'/ login/index /'로 리다이렉트하거나 성공했을 때 리다이렉트합니다. 빈 페이지가 돌아오고 있다고하니? –
실제로 내가 http://127.0.0.1:8000/login/을 쓸 때 로그인 페이지를 표시하지 않고 인덱스 페이지로 자동으로 리디렉션됩니다. – gurr