2016-07-15 00:02:56 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
2016-07-09 19:49:38 +02:00
|
|
|
|
2016-07-15 00:02:56 +02:00
|
|
|
from __future__ import division
|
|
|
|
from __future__ import print_function
|
2016-05-26 22:44:10 +02:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
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-06-08 22:28:38 +02:00
|
|
|
|
2016-07-15 00:02:56 +02:00
|
|
|
import autocomplete_light
|
|
|
|
|
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
|
|
|
|
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-05-21 23:57:36 +02:00
|
|
|
|
2016-07-18 18:46:48 +02:00
|
|
|
from gestioncof.autocomplete import autocomplete
|
|
|
|
|
2016-07-09 21:19:37 +02:00
|
|
|
autocomplete_light.autodiscover()
|
|
|
|
admin.autodiscover()
|
|
|
|
|
2016-07-18 18:46:48 +02: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),
|
|
|
|
url(r'^outsider/login$', gestioncof_views.login_ext),
|
|
|
|
url(r'^outsider/logout$', django_views.logout, {'next_page': 'home'}),
|
|
|
|
url(r'^login$', gestioncof_views.login),
|
|
|
|
url(r'^logout$', gestioncof_views.logout),
|
2016-07-09 21:19:37 +02:00
|
|
|
# Infos persos
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^profile$', gestioncof_views.profile),
|
|
|
|
url(r'^outsider/password-change$', django_views.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
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^registration$', gestioncof_views.registration),
|
2016-06-08 22:28:38 +02:00
|
|
|
url(r'^registration/clipper/(?P<login_clipper>[\w-]+)$',
|
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),
|
2016-05-21 23:57:36 +02:00
|
|
|
url(r'^autocomplete/', include('autocomplete_light.urls')),
|
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)),
|
|
|
|
url(r'^grappelli/', include('grappelli.urls')),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Liens utiles du COF et du BdA
|
2016-07-18 18:46:48 +02:00
|
|
|
url(r'^utile_cof$', gestioncof_views.utile_cof),
|
|
|
|
url(r'^utile_bda$', gestioncof_views.utile_bda),
|
|
|
|
url(r'^utile_bda/bda_diff$', gestioncof_views.liste_bdadiff),
|
|
|
|
url(r'^utile_cof/diff_cof$', gestioncof_views.liste_diffcof),
|
|
|
|
url(r'^utile_bda/bda_revente$', gestioncof_views.liste_bdarevente),
|
|
|
|
] + \
|
2016-07-09 19:49:38 +02:00
|
|
|
(static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
2016-07-15 00:02:56 +02:00
|
|
|
if settings.DEBUG
|
|
|
|
else [])
|
2016-07-09 19:49:38 +02: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.
|