mirror of
https://github.com/nanoy42/coope
synced 2024-12-23 15:33:45 +00:00
Reset password
This commit is contained in:
parent
c94296ebcc
commit
3599903359
11 changed files with 129 additions and 3 deletions
|
@ -132,4 +132,5 @@ MEDIA_URL = '/media/'
|
||||||
|
|
||||||
INTERNAL_IPS = ["127.0.0.1"]
|
INTERNAL_IPS = ["127.0.0.1"]
|
||||||
|
|
||||||
EMAIL_SUBJECT_PREFIX = "[Coope Admin] "
|
EMAIL_SUBJECT_PREFIX = "[Coopé Technopôle Metz] "
|
||||||
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # During development only
|
|
@ -32,6 +32,7 @@ urlpatterns = [
|
||||||
path('gestion/', include('gestion.urls')),
|
path('gestion/', include('gestion.urls')),
|
||||||
path('preferences/', include('preferences.urls')),
|
path('preferences/', include('preferences.urls')),
|
||||||
path('search/', include('search.urls')),
|
path('search/', include('search.urls')),
|
||||||
|
path('users/', include('django.contrib.auth.urls')),
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|
||||||
|
|
||||||
|
|
17
templates/registration/password_reset_complete.html
Normal file
17
templates/registration/password_reset_complete.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block entete %}Réinitilisation du mot de passe{% endblock %}
|
||||||
|
{% block navbar %}
|
||||||
|
<ul>
|
||||||
|
<li><a href="#first">Réinitialisation du mot de passe</a></li>
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<section id="first" class="main">
|
||||||
|
<header class="major">
|
||||||
|
<h2>Réinitialisation du mot de passe</h2>
|
||||||
|
<p>Mot de passe réinitialisé.</p>
|
||||||
|
</header>
|
||||||
|
Vous pouvez vous connecter en vous rendant sur la <a href="{% url 'users:login' %}">page de connexion</a>.
|
||||||
|
</section>
|
||||||
|
{{form.media}}
|
||||||
|
{% endblock %}
|
23
templates/registration/password_reset_confirm.html
Normal file
23
templates/registration/password_reset_confirm.html
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block entete %}Réinitilisation du mot de passe{% endblock %}
|
||||||
|
{% block navbar %}
|
||||||
|
<ul>
|
||||||
|
<li><a href="#first">Réinitialisation du mot de passe</a></li>
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<section id="first" class="main">
|
||||||
|
<header class="major">
|
||||||
|
<h2>Réinitialisation du mot de passe</h2>
|
||||||
|
</header>
|
||||||
|
<section>
|
||||||
|
<form method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ form }}
|
||||||
|
<br>
|
||||||
|
<button type="submit"><i class="fa fa-lock"></i> Changer le mot de passe</button>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
{{form.media}}
|
||||||
|
{% endblock %}
|
16
templates/registration/password_reset_done.html
Normal file
16
templates/registration/password_reset_done.html
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block entete %}Réinitilisation du mot de passe{% endblock %}
|
||||||
|
{% block navbar %}
|
||||||
|
<ul>
|
||||||
|
<li><a href="#first">Réinitialisation du mot de passe</a></li>
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<section id="first" class="main">
|
||||||
|
<header class="major">
|
||||||
|
<h2>Réinitialisation du mot de passe</h2>
|
||||||
|
<p>Un mail vous a été envoyé avec un lien pour réinitialiser le mot de passe.</p>
|
||||||
|
</header>
|
||||||
|
</section>
|
||||||
|
{{form.media}}
|
||||||
|
{% endblock %}
|
11
templates/registration/password_reset_email.html
Normal file
11
templates/registration/password_reset_email.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{% autoescape off %}
|
||||||
|
Bonjour {{user.username}},
|
||||||
|
|
||||||
|
Vous avez demandé une réinitalisation de votre mot de passe sur le site de gestion de la Coopé Technopôle Metz, vous pouvez le faire en cliquant sur le lien ci dessous:
|
||||||
|
|
||||||
|
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
|
||||||
|
|
||||||
|
Si le lien ne fonctionne pas en cliquant, vous pouvez le copier-coller dans votre navigateur,
|
||||||
|
|
||||||
|
Le staff Coopé Technopôle Metz
|
||||||
|
{% endautoescape %}
|
24
templates/registration/password_reset_form.html
Normal file
24
templates/registration/password_reset_form.html
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block entete %}Réinitilisation du mot de passe{% endblock %}
|
||||||
|
{% block navbar %}
|
||||||
|
<ul>
|
||||||
|
<li><a href="#first">Réinitialisation du mot de passe</a></li>
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<section id="first" class="main">
|
||||||
|
<header class="major">
|
||||||
|
<h2>Réinitialisation du mot de passe</h2>
|
||||||
|
<p>Vous recevrez un lien pour réinitilisaser votre mot de passe sur votre adresse e-mail.</p>
|
||||||
|
</header>
|
||||||
|
<section>
|
||||||
|
<form method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ form }}
|
||||||
|
<br>
|
||||||
|
<button type="submit"><i class="fa fa-lock"></i> Réinitialiser</button>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
{{form.media}}
|
||||||
|
{% endblock %}
|
1
templates/registration/password_reset_subject.txt
Normal file
1
templates/registration/password_reset_subject.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Réinitialisation du mot de passe Coopé TM
|
31
users/templates/users/login.html
Normal file
31
users/templates/users/login.html
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block entete %}{{form_title}}{% endblock %}
|
||||||
|
{% block navbar %}
|
||||||
|
<ul>
|
||||||
|
<li><a href="#first">{{form_title}}</a></li>
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<section id="first" class="main">
|
||||||
|
<header class="major">
|
||||||
|
<h2>{{form_title}}</h2>
|
||||||
|
<p>{{form_p}}</p>
|
||||||
|
</header>
|
||||||
|
<section>
|
||||||
|
<form action="" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ form }}
|
||||||
|
<br>
|
||||||
|
{{ extra_html | safe }}<br><br>
|
||||||
|
<button type="submit"><i class="fa fa-{{form_button_icon}}"></i> {{form_button}}</button>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
Si vous avez perdu votre mot de passe : <a href="{% url 'password_reset' %}">mot de passe oublié</a>.
|
||||||
|
</section>
|
||||||
|
{% if extra_css %}
|
||||||
|
<style>
|
||||||
|
{{extra_css}}
|
||||||
|
</style>
|
||||||
|
{% endif %}
|
||||||
|
{{form.media}}
|
||||||
|
{% endblock %}
|
|
@ -1,4 +1,5 @@
|
||||||
from django.urls import path
|
from django.urls import path, include
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
app_name="users"
|
app_name="users"
|
||||||
|
|
|
@ -38,7 +38,7 @@ def loginView(request):
|
||||||
return redirect(reverse('home'))
|
return redirect(reverse('home'))
|
||||||
else:
|
else:
|
||||||
messages.error(request, "Nom d'utilisateur et/ou mot de passe invalide")
|
messages.error(request, "Nom d'utilisateur et/ou mot de passe invalide")
|
||||||
return render(request, "form.html", {"form_entete": "Connexion", "form": form, "form_title": "Connexion", "form_button": "Se connecter", "form_button_icon": "sign-in-alt"})
|
return render(request, "users/login.html", {"form_entete": "Connexion", "form": form, "form_title": "Connexion", "form_button": "Se connecter", "form_button_icon": "sign-in-alt"})
|
||||||
|
|
||||||
@active_required
|
@active_required
|
||||||
@login_required
|
@login_required
|
||||||
|
|
Loading…
Reference in a new issue