2016-07-15 00:02:56 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
2016-07-09 19:49:38 +02:00
|
|
|
|
2016-11-06 15:39:14 +01:00
|
|
|
"""
|
|
|
|
Fichier principal de configuration des urls du projet GestioCOF
|
|
|
|
"""
|
|
|
|
|
2016-07-09 19:49:38 +02:00
|
|
|
from django.conf import settings
|
2016-07-18 18:46:48 +02:00
|
|
|
from django.conf.urls import include, url
|
2016-07-09 19:49:38 +02:00
|
|
|
from django.conf.urls.static import static
|
2016-05-21 23:57:36 +02:00
|
|
|
from django.contrib import admin
|
|
|
|
from django.views.generic.base import TemplateView
|
2016-07-18 18:46:48 +02:00
|
|
|
from django.contrib.auth import views as django_views
|
|
|
|
from django_cas_ng import views as django_cas_views
|
2016-11-06 15:39:14 +01:00
|
|
|
|
2017-05-30 20:44:30 +02:00
|
|
|
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
|
|
|
from wagtail.wagtailcore import urls as wagtail_urls
|
|
|
|
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
|
|
|
|
2016-07-18 18:46:48 +02:00
|
|
|
from gestioncof import views as gestioncof_views, csv_views
|
2016-06-08 22:28:38 +02:00
|
|
|
from gestioncof.urls import export_patterns, petitcours_patterns, \
|
2016-08-23 18:57:59 +02:00
|
|
|
surveys_patterns, events_patterns, calendar_patterns, \
|
|
|
|
clubs_patterns
|
2016-07-18 18:46:48 +02:00
|
|
|
from gestioncof.autocomplete import autocomplete
|
|
|
|
|
2016-07-09 21:19:37 +02:00
|
|
|
admin.autodiscover()
|
|
|
|
|
2016-11-06 01:36:10 +01:00
|
|
|
urlpatterns = [
|
2016-06-08 22:28:38 +02:00
|
|
|
# Page d'accueil
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^$', gestioncof_views.home, name='home'),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Le BdA
|
|
|
|
url(r'^bda/', include('bda.urls')),
|
2016-07-09 21:19:37 +02:00
|
|
|
# Les exports
|
2016-06-08 22:28:38 +02:00
|
|
|
url(r'^export/', include(export_patterns)),
|
|
|
|
# Les petits cours
|
|
|
|
url(r'^petitcours/', include(petitcours_patterns)),
|
|
|
|
# Les sondages
|
|
|
|
url(r'^survey/', include(surveys_patterns)),
|
|
|
|
# Evenements
|
|
|
|
url(r'^event/', include(events_patterns)),
|
2016-07-15 01:06:33 +02:00
|
|
|
# Calendrier
|
|
|
|
url(r'^calendar/', include(calendar_patterns)),
|
2016-08-23 18:57:59 +02:00
|
|
|
# Clubs
|
|
|
|
url(r'^clubs/', include(clubs_patterns)),
|
2016-07-09 21:19:37 +02:00
|
|
|
# Authentification
|
2016-06-08 22:28:38 +02:00
|
|
|
url(r'^cof/denied$', TemplateView.as_view(template_name='cof-denied.html'),
|
2016-07-09 22:31:56 +02:00
|
|
|
name="cof-denied"),
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^cas/login$', django_cas_views.login, name="cas_login_view"),
|
|
|
|
url(r'^cas/logout$', django_cas_views.logout),
|
2017-11-19 18:41:39 +01:00
|
|
|
url(r'^outsider/login$', gestioncof_views.login_ext,
|
|
|
|
name="ext_login_view"),
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^outsider/logout$', django_views.logout, {'next_page': 'home'}),
|
2016-11-06 01:36:10 +01:00
|
|
|
url(r'^login$', gestioncof_views.login, name="cof-login"),
|
2017-05-30 20:44:30 +02:00
|
|
|
url(r'^logout$', gestioncof_views.logout, name="cof-logout"),
|
2016-07-09 21:19:37 +02:00
|
|
|
# Infos persos
|
2017-11-19 18:41:39 +01:00
|
|
|
url(r'^profile$', gestioncof_views.profile,
|
|
|
|
name='profile'),
|
|
|
|
url(r'^outsider/password-change$', django_views.password_change,
|
|
|
|
name='password_change'),
|
2016-06-08 22:28:38 +02:00
|
|
|
url(r'^outsider/password-change-done$',
|
2016-07-18 18:46:48 +02:00
|
|
|
django_views.password_change_done,
|
2016-06-09 01:58:03 +02:00
|
|
|
name='password_change_done'),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Inscription d'un nouveau membre
|
2017-11-19 18:41:39 +01:00
|
|
|
url(r'^registration$', gestioncof_views.registration,
|
|
|
|
name='registration'),
|
2016-12-25 02:02:22 +01:00
|
|
|
url(r'^registration/clipper/(?P<login_clipper>[\w-]+)/'
|
|
|
|
r'(?P<fullname>.*)$',
|
2016-07-18 18:46:48 +02:00
|
|
|
gestioncof_views.registration_form2, name="clipper-registration"),
|
2016-06-08 22:28:38 +02:00
|
|
|
url(r'^registration/user/(?P<username>.+)$',
|
2016-07-18 18:46:48 +02:00
|
|
|
gestioncof_views.registration_form2, name="user-registration"),
|
|
|
|
url(r'^registration/empty$', gestioncof_views.registration_form2,
|
2016-07-09 22:31:56 +02:00
|
|
|
name="empty-registration"),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Autocompletion
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^autocomplete/registration$', autocomplete),
|
2017-11-19 18:41:39 +01:00
|
|
|
url(r'^user/autocomplete$', gestioncof_views.user_autocomplete,
|
|
|
|
name='cof-user-autocomplete'),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Interface admin
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^admin/logout/', gestioncof_views.logout),
|
2016-05-21 23:57:36 +02:00
|
|
|
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
2016-06-08 22:28:38 +02:00
|
|
|
url(r'^admin/(?P<app_label>[\d\w]+)/(?P<model_name>[\d\w]+)/csv/',
|
2016-07-18 18:46:48 +02:00
|
|
|
csv_views.admin_list_export,
|
2016-07-09 22:31:56 +02:00
|
|
|
{'fields': ['username', ]}),
|
2016-05-21 23:57:36 +02:00
|
|
|
url(r'^admin/', include(admin.site.urls)),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Liens utiles du COF et du BdA
|
2017-11-19 18:41:39 +01:00
|
|
|
url(r'^utile_cof$', gestioncof_views.utile_cof,
|
|
|
|
name='utile_cof'),
|
|
|
|
url(r'^utile_bda$', gestioncof_views.utile_bda,
|
|
|
|
name='utile_bda'),
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^utile_bda/bda_diff$', gestioncof_views.liste_bdadiff),
|
2018-01-22 21:53:19 +01:00
|
|
|
url(r'^utile_cof/diff_cof$', gestioncof_views.liste_diffcof,
|
|
|
|
name='ml_diffcof'),
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^utile_bda/bda_revente$', gestioncof_views.liste_bdarevente),
|
2016-11-06 01:36:10 +01:00
|
|
|
url(r'^k-fet/', include('kfet.urls')),
|
2017-05-30 20:44:30 +02:00
|
|
|
url(r'^cms/', include(wagtailadmin_urls)),
|
|
|
|
url(r'^documents/', include(wagtaildocs_urls)),
|
2017-05-26 00:58:59 +02:00
|
|
|
# djconfig
|
2018-01-22 21:53:19 +01:00
|
|
|
url(r"^config", gestioncof_views.ConfigUpdate.as_view(),
|
|
|
|
name='config.edit'),
|
2016-09-12 22:08:39 +02:00
|
|
|
]
|
|
|
|
|
2017-04-03 23:55:54 +02:00
|
|
|
if 'debug_toolbar' in settings.INSTALLED_APPS:
|
2016-11-06 15:39:14 +01:00
|
|
|
import debug_toolbar
|
2016-11-06 19:44:05 +01:00
|
|
|
urlpatterns += [
|
|
|
|
url(r'^__debug__/', include(debug_toolbar.urls)),
|
2016-11-06 15:39:14 +01:00
|
|
|
]
|
|
|
|
|
2017-05-30 20:44:30 +02:00
|
|
|
if settings.DEBUG:
|
2016-11-06 01:36:10 +01:00
|
|
|
# Si on est en production, MEDIA_ROOT est servi par Apache.
|
|
|
|
# Il faut dire à Django de servir MEDIA_ROOT lui-même en développement.
|
2016-11-18 01:09:39 +01:00
|
|
|
urlpatterns += static(settings.MEDIA_URL,
|
|
|
|
document_root=settings.MEDIA_ROOT)
|
2017-05-30 20:44:30 +02:00
|
|
|
|
|
|
|
# Wagtail for uncatched
|
|
|
|
urlpatterns += [
|
|
|
|
url(r'', include(wagtail_urls)),
|
|
|
|
]
|