Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sign_in(request):
- """
- Controls a view.
- """
- if request.method == "POST":
- user = AUTHENTICATE(username = request.POST["username"],
- password = request.POST["password"])
- if user:
- LOGIN(request, user)
- next_ = request.GET.get("next", "/my_phil4")
- response = REDIRECT(next_)
- else:
- response = REDIRECT("/sign_in")
- else:
- form = django.contrib.auth.forms.AuthenticationForm()
- current_page = sys._getframe(0).f_code.co_name
- current_year = datetime.date.today().year
- response = RESPONSE(request,
- "sign_in.html",
- {"form" : form,
- "menu_items" : MENU_ITEMS,
- "current_page" : current_page,
- "current_year" : current_year})
- return response
Add Comment
Please, Sign In to add comment