add auth templates

This commit is contained in:
Michał Najborowski 2022-01-23 22:34:16 +01:00
parent 0826b66e33
commit defafa6e4b
4 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<!-- templates/base.html -->
<!DOCTYPE html>
<html>
<head>
{% load static %}
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="{% static 'base.css'%}">
<meta charset="utf-8">
<title>{% block title %}Auth{% endblock %}</title>
</head>
<body>
<main>
{% block content %}
{% endblock %}
</main>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!-- templates/home.html-->
{% extends 'base.html' %}
{% block title %}Home{% endblock %}
{% block content %}
{% if user.is_authenticated %}
Hi {{ user.username }}!
<p><a href="{% url 'logout' %}">Log Out</a></p>
{% else %}
<p>You are not logged in</p>
<p><a href="{% url 'login' %}">Log In</a></p>
<p><a href="{% url 'signup' %}">Sign Up</a></p>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,13 @@
<!-- templates/registration/login.html -->
{% extends 'base.html' %}
{% block title %}Login{% endblock %}
{% block content %}
<h2>Log In</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Log In</button>
</form>
{% endblock %}

View File

@ -0,0 +1,13 @@
<!-- templates/registration/signup.html -->
{% extends 'base.html' %}
{% block title %}Sign Up{% endblock %}
{% block content %}
<h2>Sign Up</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Sign Up</button>
</form>
{% endblock %}