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
|
2016-07-18 18:46:48 +02:00
|
|
|
from django.contrib.auth import views as django_views
|
2018-10-06 12:35:49 +02:00
|
|
|
from django.views.generic.base import TemplateView
|
2016-07-18 18:46:48 +02:00
|
|
|
from django_cas_ng import views as django_cas_views
|
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
|
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
from gestioncof import csv_views, views as gestioncof_views
|
2016-07-18 18:46:48 +02:00
|
|
|
from gestioncof.autocomplete import autocomplete
|
2018-10-06 12:35:49 +02:00
|
|
|
from gestioncof.urls import (
|
|
|
|
calendar_patterns,
|
|
|
|
clubs_patterns,
|
|
|
|
events_patterns,
|
|
|
|
export_patterns,
|
|
|
|
surveys_patterns,
|
|
|
|
)
|
2016-07-18 18:46:48 +02:00
|
|
|
|
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
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^$", gestioncof_views.home, name="home"),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Le BdA
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^bda/", include("bda.urls")),
|
2016-07-09 21:19:37 +02:00
|
|
|
# Les exports
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^export/", include(export_patterns)),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Les petits cours
|
2018-11-25 00:37:22 +01:00
|
|
|
url(r"^petitcours/", include("petitscours.urls")),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Les sondages
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^survey/", include(surveys_patterns)),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Evenements
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^event/", include(events_patterns)),
|
2016-07-15 01:06:33 +02:00
|
|
|
# Calendrier
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^calendar/", include(calendar_patterns)),
|
2016-08-23 18:57:59 +02:00
|
|
|
# Clubs
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^clubs/", include(clubs_patterns)),
|
2016-07-09 21:19:37 +02:00
|
|
|
# Authentification
|
2018-10-06 12:35:49 +02:00
|
|
|
url(
|
|
|
|
r"^cof/denied$",
|
|
|
|
TemplateView.as_view(template_name="cof-denied.html"),
|
|
|
|
name="cof-denied",
|
|
|
|
),
|
|
|
|
url(r"^cas/login$", django_cas_views.login, name="cas_login_view"),
|
|
|
|
url(r"^cas/logout$", django_cas_views.logout),
|
|
|
|
url(r"^outsider/login$", gestioncof_views.login_ext, name="ext_login_view"),
|
|
|
|
url(r"^outsider/logout$", django_views.logout, {"next_page": "home"}),
|
|
|
|
url(r"^login$", gestioncof_views.login, name="cof-login"),
|
|
|
|
url(r"^logout$", gestioncof_views.logout, name="cof-logout"),
|
2016-07-09 21:19:37 +02:00
|
|
|
# Infos persos
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^profile$", gestioncof_views.profile, name="profile"),
|
|
|
|
url(
|
|
|
|
r"^outsider/password-change$",
|
|
|
|
django_views.password_change,
|
|
|
|
name="password_change",
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^outsider/password-change-done$",
|
2016-07-18 18:46:48 +02:00
|
|
|
django_views.password_change_done,
|
2018-10-06 12:35:49 +02:00
|
|
|
name="password_change_done",
|
|
|
|
),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Inscription d'un nouveau membre
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^registration$", gestioncof_views.registration, name="registration"),
|
|
|
|
url(
|
|
|
|
r"^registration/clipper/(?P<login_clipper>[\w-]+)/" r"(?P<fullname>.*)$",
|
|
|
|
gestioncof_views.registration_form2,
|
|
|
|
name="clipper-registration",
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^registration/user/(?P<username>.+)$",
|
|
|
|
gestioncof_views.registration_form2,
|
|
|
|
name="user-registration",
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^registration/empty$",
|
|
|
|
gestioncof_views.registration_form2,
|
|
|
|
name="empty-registration",
|
|
|
|
),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Autocompletion
|
2018-10-06 12:35:49 +02:00
|
|
|
url(
|
|
|
|
r"^autocomplete/registration$",
|
|
|
|
autocomplete,
|
|
|
|
name="cof.registration.autocomplete",
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^user/autocomplete$",
|
|
|
|
gestioncof_views.user_autocomplete,
|
|
|
|
name="cof-user-autocomplete",
|
|
|
|
),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Interface admin
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^admin/logout/", gestioncof_views.logout),
|
|
|
|
url(r"^admin/doc/", include("django.contrib.admindocs.urls")),
|
|
|
|
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,
|
2018-10-06 12:35:49 +02:00
|
|
|
{"fields": ["username"]},
|
|
|
|
),
|
|
|
|
url(r"^admin/", include(admin.site.urls)),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Liens utiles du COF et du BdA
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^utile_cof$", gestioncof_views.utile_cof, name="utile_cof"),
|
|
|
|
url(r"^utile_bda$", gestioncof_views.utile_bda, name="utile_bda"),
|
|
|
|
url(r"^utile_bda/bda_diff$", gestioncof_views.liste_bdadiff, name="ml_diffbda"),
|
|
|
|
url(r"^utile_cof/diff_cof$", gestioncof_views.liste_diffcof, name="ml_diffcof"),
|
|
|
|
url(
|
|
|
|
r"^utile_bda/bda_revente$",
|
|
|
|
gestioncof_views.liste_bdarevente,
|
|
|
|
name="ml_bda_revente",
|
|
|
|
),
|
|
|
|
url(r"^k-fet/", include("kfet.urls")),
|
|
|
|
url(r"^cms/", include(wagtailadmin_urls)),
|
|
|
|
url(r"^documents/", include(wagtaildocs_urls)),
|
2017-05-26 00:58:59 +02:00
|
|
|
# djconfig
|
2018-10-06 12:35:49 +02:00
|
|
|
url(r"^config", gestioncof_views.ConfigUpdate.as_view(), name="config.edit"),
|
2016-09-12 22:08:39 +02:00
|
|
|
]
|
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
if "debug_toolbar" in settings.INSTALLED_APPS:
|
2016-11-06 15:39:14 +01:00
|
|
|
import debug_toolbar
|
2018-10-06 12:35:49 +02: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.
|
2018-10-06 12:35:49 +02:00
|
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
2017-05-30 20:44:30 +02:00
|
|
|
|
|
|
|
# Wagtail for uncatched
|
2018-10-06 12:35:49 +02:00
|
|
|
urlpatterns += [url(r"", include(wagtail_urls))]
|