update login view

This commit is contained in:
2020-10-05 14:39:44 +00:00
parent bfa935558b
commit 6aa6ef9023
3 changed files with 30 additions and 118 deletions

View File

@@ -0,0 +1,6 @@
from django import forms
class LoginForm(forms.Form):
username = forms.CharField()
password = forms.CharField(label='Passwort', widget=forms.PasswordInput())

View File

@@ -3,9 +3,11 @@ from django.contrib.auth import login, logout
from django.contrib import messages
from django.contrib.auth.models import User
from documents.etherpadlib import del_ep_cookie
from .authentications import authentication
from .decorators import unauthenticated_user, authenticated_user
from documents.etherpadlib import del_ep_cookie
from .forms import LoginForm
@unauthenticated_user
@@ -27,7 +29,11 @@ def loginPage(request):
else:
messages.info(request, 'username or password is incorrect')
context = {}
form = LoginForm()
context = {
"form": form,
}
return render(request, 'authentications/login.html', context)