Example #1
0
def login(request):
    login_form = LogInForm()
    if request.method == "POST":
        login_form = LogInForm(request.POST)
        if login_form.is_valid():
            cd = login_form.cleaned_data
            user = authenticate(username=cd["username"], password=cd["password"])
            if user != None and user.is_authenticated():
                dlogin(request, user)
                return redirect('/')
    return render("login.html", request, {"login_form": login_form })
Example #2
0
def home(request):
    Menu.process("main", request)
    return render("auth.html", request)