Added User Authentification and static/css/login.css
This commit is contained in:
24
core/accounts/templates/registration/login.html
Normal file
24
core/accounts/templates/registration/login.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login</title>
|
||||
<link rel="stylesheet" href="{% static 'css/login.css' %}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="login-container">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="input-group">
|
||||
<input type="text" name="username" id="username" required placeholder="BENUTZERNAME">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<input type="password" name="password" id="password" required placeholder="PASSWORT">
|
||||
</div>
|
||||
<button type="submit" class="login-button">LOG IN</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,10 @@
|
||||
from django.urls import path # type: ignore
|
||||
from . import views
|
||||
from django.contrib.auth.views import LogoutView
|
||||
from django.contrib.auth.views import LoginView
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.home)
|
||||
path('', views.home),
|
||||
path('logout/', LogoutView.as_view(), name='logout'),
|
||||
path('accounts/login/', LoginView.as_view(), name='login'),
|
||||
]
|
||||
@@ -1,5 +1,7 @@
|
||||
from django.shortcuts import render
|
||||
from django.contrib.auth.decorators import login_required
|
||||
|
||||
# Create your views here.
|
||||
@login_required
|
||||
def home(request):
|
||||
return render(request, 'accounts/home.html')
|
||||
|
||||
4
static/css/login.css
Normal file
4
static/css/login.css
Normal file
@@ -0,0 +1,4 @@
|
||||
/*This is the Stylesheet for the Login Screen*/
|
||||
body {
|
||||
background-color: #da1f3d;
|
||||
}
|
||||
Reference in New Issue
Block a user