Add working authorization and registration
This commit is contained in:
@@ -3,13 +3,15 @@
|
||||
|
||||
{% block content %}
|
||||
<h1> Ваш аккаунт </h1>
|
||||
<h3>Регистрация</h3>
|
||||
<form action="" method="POST">{% csrf_token %}
|
||||
<table>
|
||||
<tbody>
|
||||
{{ form.as_table }}
|
||||
</tbody>
|
||||
</table>
|
||||
<button type="submit">Регистрация</button>
|
||||
</form>
|
||||
{% if user.is_authenticated %}
|
||||
Ваше имя: {{ user.name }}<br>
|
||||
Ваша фамилия: {{ user.surname }}<br>
|
||||
Ваша почта: {{ user.email }}<br>
|
||||
Ваш телефон: {{ user.phone }}<br>
|
||||
{% else %}
|
||||
Вы не вошли
|
||||
<a href="{% url 'login' %}">Вход</a>
|
||||
<a href="{% url 'register' %}">Регистрация</a>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
@@ -27,6 +27,15 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
Добро пожаловать, {{ user.name }} {{ user.surname }}<br>
|
||||
<a href="{% url 'logout'%}?next={{request.path}}">Выход</a>
|
||||
{% else %}
|
||||
Вы не вошли
|
||||
<a href="{% url 'login'%}?next={{request.path}}">Вход</a>
|
||||
{% endif %}
|
||||
|
||||
<nav>
|
||||
<a href="{% url 'index' %}">На главную</a>
|
||||
<a href="{% url 'account' %}">Аккаунт</a>
|
||||
|
@@ -1,6 +1,14 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %} Аккаунт | вход {% endblock %}
|
||||
|
||||
{% block styles %}
|
||||
<style>
|
||||
.error_class {
|
||||
border: red solid 2px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1> Ваш аккаунт </h1>
|
||||
<h3>Вход</h3>
|
||||
|
Reference in New Issue
Block a user