specifying home as... home in urls

This commit is contained in:
Qwann 2017-02-21 16:02:23 +01:00
parent b042ec1478
commit cdf5fbb285
3 changed files with 12 additions and 11 deletions

View file

@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
from django.core.urlresolvers import reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -61,6 +62,8 @@ MIDDLEWARE_CLASSES = [
ROOT_URLCONF = 'evenementiel.urls'
LOGIN_REDIRECT_URL = reverse_lazy('shared:home')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'shared/static/'),
]

View file

@ -1,3 +1,5 @@
from django.shortcuts import render
from django.views.generic import TemplateView
# Create your views here.
class Home(TemplateView):
template_name = "home.html"

View file

@ -1,7 +1,7 @@
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.core.urlresolvers import reverse_lazy
from event.views import Index # TODO : mettre le vrai home
from shared.views import Home
from user.views import CreateUser
app_name = 'user'
@ -22,16 +22,14 @@ urlpatterns = [
# LOGOUT
url('^logout/$',
auth_views.logout,
# TODO : mettre le vrai home
{'next_page': reverse_lazy('event:index'),
{'next_page': reverse_lazy('shared:home'),
},
name='logout',),
# PASSWORD_CHANGE
url('^password_change/$',
auth_views.password_change,
{'template_name': 'user/change_pass.html',
# TODO : mettre le vrai home
'post_change_redirect': reverse_lazy('event:index'),
'post_change_redirect': reverse_lazy('shared:home'),
'extra_context': {
'page_title': 'Changement de mot de passe',
'button': 'Modifier',
@ -54,8 +52,7 @@ urlpatterns = [
name='password_reset'),
# PASS RESET DONE
url('^password_reset/done/$',
# TODO : mettre le vrai home
Index.as_view(),
Home.as_view(),
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})/$',
@ -71,7 +68,6 @@ urlpatterns = [
name='password_reset_confirm'),
# PASS RESET COMPLETE
url('^reset/done/$',
# TODO : mettre le vrai home
Index.as_view(),
Home.as_view(),
name='password_reset_complete'),
]