update login view
This commit is contained in:
6
fet2020/authentications/forms.py
Normal file
6
fet2020/authentications/forms.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django import forms
|
||||
|
||||
|
||||
class LoginForm(forms.Form):
|
||||
username = forms.CharField()
|
||||
password = forms.CharField(label='Passwort', widget=forms.PasswordInput())
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user