python - Django Login Require Issues -
i sorry if question obvious still new django.
i have view:
import logging @login_required(login_url='/accounts/login/') def index(request): return render(request, 'post.html', {}) def new(request): return render(request, 'post-add.html',)
the login redirects correctly if go post page if got post add login not required.
am using login require correctly ?
if want redirect when try open "post-add" without login, need decorator(@login_required(login_url='/accounts/login/') ).
Comments
Post a Comment