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 import os
from django.core.urlresolvers import reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -61,6 +62,8 @@ MIDDLEWARE_CLASSES = [
ROOT_URLCONF = 'evenementiel.urls' ROOT_URLCONF = 'evenementiel.urls'
LOGIN_REDIRECT_URL = reverse_lazy('shared:home')
STATICFILES_DIRS = [ STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'shared/static/'), 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.conf.urls import url
from django.contrib.auth import views as auth_views from django.contrib.auth import views as auth_views
from django.core.urlresolvers import reverse_lazy 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 from user.views import CreateUser
app_name = 'user' app_name = 'user'
@ -22,16 +22,14 @@ urlpatterns = [
# LOGOUT # LOGOUT
url('^logout/$', url('^logout/$',
auth_views.logout, auth_views.logout,
# TODO : mettre le vrai home {'next_page': reverse_lazy('shared:home'),
{'next_page': reverse_lazy('event:index'),
}, },
name='logout',), name='logout',),
# PASSWORD_CHANGE # PASSWORD_CHANGE
url('^password_change/$', url('^password_change/$',
auth_views.password_change, auth_views.password_change,
{'template_name': 'user/change_pass.html', {'template_name': 'user/change_pass.html',
# TODO : mettre le vrai home 'post_change_redirect': reverse_lazy('shared:home'),
'post_change_redirect': reverse_lazy('event:index'),
'extra_context': { 'extra_context': {
'page_title': 'Changement de mot de passe', 'page_title': 'Changement de mot de passe',
'button': 'Modifier', 'button': 'Modifier',
@ -54,8 +52,7 @@ urlpatterns = [
name='password_reset'), name='password_reset'),
# PASS RESET DONE # PASS RESET DONE
url('^password_reset/done/$', url('^password_reset/done/$',
# TODO : mettre le vrai home Home.as_view(),
Index.as_view(),
name='password_reset_done'), name='password_reset_done'),
# PASS RESET CONFIRM # 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})/$', 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'), name='password_reset_confirm'),
# PASS RESET COMPLETE # PASS RESET COMPLETE
url('^reset/done/$', url('^reset/done/$',
# TODO : mettre le vrai home Home.as_view(),
Index.as_view(),
name='password_reset_complete'), name='password_reset_complete'),
] ]