Added User Authentification and static/css/login.css

This commit is contained in:
2025-01-17 17:48:55 +01:00
parent 34af915fe9
commit 7cbd2fe8dd
4 changed files with 35 additions and 1 deletions

View 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>

View File

@@ -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'),
]

View File

@@ -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
View File

@@ -0,0 +1,4 @@
/*This is the Stylesheet for the Login Screen*/
body {
background-color: #da1f3d;
}