Login

Tag "auth"

Snippet List

newforms self-contained login form

A simple login form that does the actual authentification itself. **Usage:** if request.method == "POST": loginform = LoginForm(request.POST) if loginform.login(): return HttpResponseRedirect(redir_url) else: loginform = LoginForm()

  • newforms
  • login
  • auth
Read More

Auth decorators with 403

These decorators are based on user_passes_test and permission_required, but when a user is logged in and fails the test, it will render a 403 error instead of redirecting to login - only anonymous users will be asked to login.

  • auth
  • user_passes_test
  • 403
  • permission_required
Read More

64 snippets posted so far.