feat: implement user authentication features (registration, activation, and password reset)
All checks were successful
Build and Push Docker Image / build (push) Successful in 46s
All checks were successful
Build and Push Docker Image / build (push) Successful in 46s
- Added email templates for activation and password reset (`activation_email.html`, `password_reset_email.html`, etc.) - Created forms for registration (`RegisterForm`) and login (`LoginForm`) with custom validation - Developed new pages for account activation (`activation_success.html`, `activation_invalid.html`), password reset workflow, and profile - Configured email backend and environment file handling in settings - Updated header template to conditionally display profile or login links based on authentication status - Enhanced CSS styles for authentication-related pages and forms
This commit is contained in:
20
templates/users/emails/activation_email.html
Normal file
20
templates/users/emails/activation_email.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<html lang="ru">
|
||||
<body style="margin:0;padding:24px;font-family:Arial,sans-serif;background:#f5f7fa;color:#36213e;">
|
||||
<div style="max-width:640px;margin:0 auto;background:#ffffff;border:1px solid #d6dde6;padding:32px;">
|
||||
<h1 style="margin:0 0 16px;font-size:28px;color:#36213e;">Подтверждение регистрации</h1>
|
||||
<p style="margin:0 0 16px;font-size:16px;line-height:1.5;">
|
||||
Здравствуйте{% if user.get_full_name %}, {{ user.get_full_name }}{% endif %}!
|
||||
</p>
|
||||
<p style="margin:0 0 24px;font-size:16px;line-height:1.5;">
|
||||
Спасибо за регистрацию в {{ site_name }}. Подтвердите почту, чтобы активировать аккаунт.
|
||||
</p>
|
||||
<p style="margin:0 0 24px;">
|
||||
<a href="{{ activation_url }}" style="display:inline-block;padding:14px 22px;background:#63768d;color:#ffffff;text-decoration:none;">Подтвердить почту</a>
|
||||
</p>
|
||||
<p style="margin:0;font-size:14px;line-height:1.5;color:#554971;">
|
||||
Если кнопка не работает, скопируйте ссылку в браузер:<br>
|
||||
<a href="{{ activation_url }}">{{ activation_url }}</a>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
8
templates/users/emails/activation_email.txt
Normal file
8
templates/users/emails/activation_email.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Здравствуйте{% if user.get_full_name %}, {{ user.get_full_name }}{% endif %}!
|
||||
|
||||
Спасибо за регистрацию в {{ site_name }}.
|
||||
|
||||
Чтобы активировать аккаунт, перейдите по ссылке:
|
||||
{{ activation_url }}
|
||||
|
||||
Если вы не создавали аккаунт, просто проигнорируйте это письмо.
|
||||
1
templates/users/emails/activation_subject.txt
Normal file
1
templates/users/emails/activation_subject.txt
Normal file
@@ -0,0 +1 @@
|
||||
Подтверждение регистрации в {{ site_name }}
|
||||
19
templates/users/emails/password_reset_email.html
Normal file
19
templates/users/emails/password_reset_email.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<html lang="ru">
|
||||
<body style="margin:0;padding:24px;font-family:Arial,sans-serif;background:#f5f7fa;color:#36213e;">
|
||||
<div style="max-width:640px;margin:0 auto;background:#ffffff;border:1px solid #d6dde6;padding:32px;">
|
||||
<h1 style="margin:0 0 16px;font-size:28px;color:#36213e;">Восстановление пароля</h1>
|
||||
<p style="margin:0 0 24px;font-size:16px;line-height:1.5;">
|
||||
Вы запросили смену пароля для аккаунта в {{ site_name|default:"SantehRay" }}.
|
||||
</p>
|
||||
<p style="margin:0 0 24px;">
|
||||
<a href="{{ protocol }}://{{ domain }}{% url 'users:password_reset_confirm' uidb64=uid token=token %}" style="display:inline-block;padding:14px 22px;background:#63768d;color:#ffffff;text-decoration:none;">Сменить пароль</a>
|
||||
</p>
|
||||
<p style="margin:0;font-size:14px;line-height:1.5;color:#554971;">
|
||||
Если кнопка не работает, используйте ссылку:<br>
|
||||
<a href="{{ protocol }}://{{ domain }}{% url 'users:password_reset_confirm' uidb64=uid token=token %}">
|
||||
{{ protocol }}://{{ domain }}{% url 'users:password_reset_confirm' uidb64=uid token=token %}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
8
templates/users/emails/password_reset_email.txt
Normal file
8
templates/users/emails/password_reset_email.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Здравствуйте!
|
||||
|
||||
Вы запросили восстановление пароля в {{ site_name|default:"SantehRay" }}.
|
||||
|
||||
Перейдите по ссылке, чтобы задать новый пароль:
|
||||
{{ protocol }}://{{ domain }}{% url 'users:password_reset_confirm' uidb64=uid token=token %}
|
||||
|
||||
Если вы не отправляли этот запрос, просто проигнорируйте это письмо.
|
||||
1
templates/users/emails/password_reset_subject.txt
Normal file
1
templates/users/emails/password_reset_subject.txt
Normal file
@@ -0,0 +1 @@
|
||||
Восстановление пароля в {{ site_name|default:"SantehRay" }}
|
||||
Reference in New Issue
Block a user