2017-02-20 18:42:37 +01:00
|
|
|
from django.conf.urls import url
|
2017-02-18 01:45:22 +01:00
|
|
|
from django.contrib.auth import views as auth_views
|
|
|
|
from django.core.urlresolvers import reverse_lazy
|
2017-02-21 16:02:23 +01:00
|
|
|
from shared.views import Home
|
2017-02-18 01:45:22 +01:00
|
|
|
from user.views import CreateUser
|
|
|
|
|
|
|
|
app_name = 'user'
|
|
|
|
urlpatterns = [
|
|
|
|
# CREATE USER
|
|
|
|
url('^create/$', CreateUser.as_view(), name='create_user'),
|
|
|
|
# LOGIN
|
|
|
|
url('^login/$',
|
|
|
|
auth_views.login,
|
2017-02-20 18:42:37 +01:00
|
|
|
{'template_name': 'user/login.html',
|
|
|
|
'extra_context': {
|
|
|
|
'page_title': 'Connexion',
|
|
|
|
'button': 'Se connecter',
|
|
|
|
},
|
|
|
|
},
|
2017-02-18 01:45:22 +01:00
|
|
|
name='login',
|
2017-02-20 18:42:37 +01:00
|
|
|
),
|
2017-02-18 01:45:22 +01:00
|
|
|
# LOGOUT
|
2017-02-20 18:42:37 +01:00
|
|
|
url('^logout/$',
|
2017-02-18 01:45:22 +01:00
|
|
|
auth_views.logout,
|
2017-02-21 16:02:23 +01:00
|
|
|
{'next_page': reverse_lazy('shared:home'),
|
2017-02-20 18:42:37 +01:00
|
|
|
},
|
2017-02-18 01:45:22 +01:00
|
|
|
name='logout',),
|
|
|
|
# PASSWORD_CHANGE
|
|
|
|
url('^password_change/$',
|
|
|
|
auth_views.password_change,
|
2017-02-20 18:42:37 +01:00
|
|
|
{'template_name': 'user/change_pass.html',
|
2017-02-21 16:02:23 +01:00
|
|
|
'post_change_redirect': reverse_lazy('shared:home'),
|
2017-02-20 18:42:37 +01:00
|
|
|
'extra_context': {
|
|
|
|
'page_title': 'Changement de mot de passe',
|
|
|
|
'button': 'Modifier',
|
|
|
|
},
|
|
|
|
},
|
2017-02-18 01:45:22 +01:00
|
|
|
name='password_change'),
|
|
|
|
# url('^password_change/done/$', name='password_change_done'),
|
|
|
|
# RESET PASSWORD
|
|
|
|
url('^password_reset/$',
|
|
|
|
auth_views.password_reset,
|
2017-02-20 18:42:37 +01:00
|
|
|
{'template_name': 'user/password_reset.html',
|
|
|
|
'email_template_name': 'email_password_reset.html',
|
|
|
|
'subject_template_name': 'subject_password_reset.txt',
|
|
|
|
'post_reset_redirect': reverse_lazy('user:password_reset_done'),
|
|
|
|
'extra_context': {
|
2017-02-21 11:07:36 +01:00
|
|
|
'page_title': 'Demander un nouveau mot de passe',
|
2017-02-20 18:42:37 +01:00
|
|
|
'button': 'Envoyer'
|
|
|
|
},
|
|
|
|
},
|
2017-02-18 01:45:22 +01:00
|
|
|
name='password_reset'),
|
|
|
|
# PASS RESET DONE
|
2017-02-20 18:42:37 +01:00
|
|
|
url('^password_reset/done/$',
|
2017-02-21 16:02:23 +01:00
|
|
|
Home.as_view(),
|
2017-02-18 01:45:22 +01:00
|
|
|
name='password_reset_done'),
|
|
|
|
# PASS RESET CONFIRM
|
|
|
|
url('^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
|
|
|
|
auth_views.password_reset_confirm,
|
|
|
|
{
|
2017-02-20 18:42:37 +01:00
|
|
|
'template_name': 'user/user_form.html',
|
|
|
|
'post_reset_redirect': reverse_lazy('user:password_reset_complete'),
|
|
|
|
'extra_context': {
|
|
|
|
'page_title': 'Changer de mot de passe',
|
|
|
|
'button': 'Changer'
|
|
|
|
},
|
|
|
|
},
|
2017-02-18 01:45:22 +01:00
|
|
|
name='password_reset_confirm'),
|
|
|
|
# PASS RESET COMPLETE
|
|
|
|
url('^reset/done/$',
|
2017-02-21 16:02:23 +01:00
|
|
|
Home.as_view(),
|
2017-02-18 01:45:22 +01:00
|
|
|
name='password_reset_complete'),
|
|
|
|
]
|