First initial commit for test Django website

This commit is contained in:
Alexander Schulz
2024-08-30 16:35:36 +02:00
commit 014b3995ae
169 changed files with 32693 additions and 0 deletions

10
templates/about.html Normal file
View File

@ -0,0 +1,10 @@
{% extends 'layout.html' %}
{% block title %}
About
{% endblock %}
{% block content %}
<h1>About</h1>
<p>Check out my <a href="/">Home</a> page.</p>
{% endblock %}

10
templates/home.html Normal file
View File

@ -0,0 +1,10 @@
{% extends 'layout.html' %}
{% block title %}
Home
{% endblock %}
{% block content %}
<h1>Home</h1>
<p>Check out my <a href="/about">About</a> page.</p>
{% endblock %}

48
templates/layout.html Normal file
View File

@ -0,0 +1,48 @@
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
{% block title %}
Django App
{% endblock %}
</title>
<link rel="stylesheet" href="{% static 'css/style.css' %}">
<script src="{% static 'js/main.js' %}" defer></script>
</head>
<body>
<nav>
<a href="/">
<span role="img" aria-label="Home" title="Home">🏠</span>
</a> |
<a href="/about">
<span role="img" aria-label="About" title="About">😀</span>
</a> |
<a href="{% url 'post:list' %}">
<span role="img" aria-label="Posts" title="Posts">📰</span>
</a> |
{% if user.is_authenticated %}
<a href="{% url 'post:new-post' %}">
<span role="img" aria-label="New Post" title="New Post">🆕</span>
</a> |
<form class="logout" action="{% url 'users:logout' %}" method="post">
{% csrf_token %}
<button class="logout-button" aria-label="User Logout" title="User Logout">👋</button>
</form>
{% else %}
<a href="{% url 'users:register' %}">
<span role="img" aria-label="User Registration" title="User Registration">🚀</span>
</a> |
<a href="{% url 'users:login' %}">
<span role="img" aria-label="User Login" title="User Login">🔏</span>
</a>
{% endif %}
</nav>
<main>
{% block content %}
{% endblock %}
</main>
</body>
</html>