add mail registration to app

This commit is contained in:
2021-10-27 20:03:41 +03:00
parent 196e9ab73b
commit 1b19a007ae
12 changed files with 167 additions and 33 deletions

View File

@@ -0,0 +1,29 @@
{% extends "base.html" %}
{% block content %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,700">
<title>Bootstrap Simple Login Form with Blue Background</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<style>
body {
color: #fff;
background: #3598dc;
font-family: 'Roboto', sans-serif;
}
.info-form {
padding-top: 100px;
text-align: center;
}
</style>
<div class="info-form" >
<h3>{{message}}</h3>
</div>
{% endblock %}

View File

@@ -98,7 +98,11 @@ body {
<hr>
{% csrf_token %}
<div class="form-group">
<input type="text" class="form-control" name="username" placeholder="Username" required="required">
{% if form.username.value %}
<input type="text" class="form-control" name="username" value="{{ form.username.value }}">
{% else %}
<input type="text" class="form-control" name="username" placeholder="Username" required="required">
{% endif %}
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" placeholder="Password" required="required">

View File

@@ -1,6 +1,8 @@
<!doctype html>
<body>
<div>
<p style="color: green">Добро пожаловать, {{ username }}!</p>
<p style="color: green">Добро пожаловать, {{username}}!</p>
<p style="color: green">Чтобы активировать учётную запись перейдите по ссылке:
<a href="{{text_content}}">Завершить регистрацию</a></p>
</div>
</body>

View File

@@ -93,7 +93,6 @@ body {
</style>
<div class="signup-form">
<form method="post">
<h2>Sign Up</h2>
<p>Please fill in this form to create an account!</p>
<hr>
{% csrf_token %}
@@ -131,9 +130,8 @@ body {
{% if form.mobile.value %}
<input type="text" class="form-control" name="mobile" value="{{ form.mobile.value }}">
{% else %}
<input id="mobile" type="row" class="form-control" name="mobile" placeholder="Mobile" >
<input id="mobile" type="row" class="form-control" name="mobile" placeholder="Mobile (Not required)">
{% endif %}
<label for="mobile">Not required</label>
<div class="form-group">{{ form.mobile.errors }}</div>
</div>
<div class="form-group">
@@ -144,9 +142,17 @@ body {
<div class="form-group">{{ form.password2.errors }}</div>
</div>
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="form-group g-recaptcha" data-sitekey="6LcaYfgcAAAAAEX1GE9myoMEA2xVhWOrXqKUke_j"></div>
{% if messages %}
{% for message in messages %}
{{ message }}
{% endfor %}
{% endif %}
<div class="form-group">
<button type="submit" class="btn btn-primary btn-lg">Sign Up</button>
</div>
</div>
<div class="form-group">{{ form.non_field_errors }}</div>
</form>
<div class="hint-text">Already have an account? <a href="{% url 'accounts:login' %}">Login here</a></div>