add auth templates
This commit is contained in:
parent
0826b66e33
commit
defafa6e4b
18
Serwer_django/templates/base.html
Normal file
18
Serwer_django/templates/base.html
Normal 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>
|
15
Serwer_django/templates/home.html
Normal file
15
Serwer_django/templates/home.html
Normal 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 %}
|
13
Serwer_django/templates/registration/login.html
Normal file
13
Serwer_django/templates/registration/login.html
Normal 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 %}
|
13
Serwer_django/templates/registration/signup.html
Normal file
13
Serwer_django/templates/registration/signup.html
Normal 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 %}
|
Loading…
Reference in New Issue
Block a user