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-05-21 23:57:36 +02:00
|
|
|
from django.conf.urls import patterns, 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-06-08 22:28:38 +02:00
|
|
|
from gestioncof.urls import export_patterns, petitcours_patterns, \
|
|
|
|
surveys_patterns, events_patterns
|
2016-05-21 23:57:36 +02:00
|
|
|
|
2016-07-09 21:19:37 +02:00
|
|
|
autocomplete_light.autodiscover()
|
|
|
|
admin.autodiscover()
|
|
|
|
|
2016-07-09 22:31:56 +02:00
|
|
|
urlpatterns = patterns(
|
|
|
|
'',
|
2016-06-08 22:28:38 +02:00
|
|
|
# Page d'accueil
|
2016-07-09 21:19:37 +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-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-06-08 22:28:38 +02:00
|
|
|
url(r'^cas/login$', 'django_cas_ng.views.login', name="cas_login_view"),
|
2016-05-26 22:20:04 +02:00
|
|
|
url(r'^cas/logout$', 'django_cas_ng.views.logout'),
|
2016-05-21 23:57:36 +02:00
|
|
|
url(r'^outsider/login$', 'gestioncof.views.login_ext'),
|
2016-06-08 22:28:38 +02:00
|
|
|
url(r'^outsider/logout$', 'django.contrib.auth.views.logout',
|
2016-07-09 22:31:56 +02:00
|
|
|
{'next_page': 'home'}),
|
2016-05-21 23:57:36 +02:00
|
|
|
url(r'^login$', 'gestioncof.views.login'),
|
|
|
|
url(r'^logout$', 'gestioncof.views.logout'),
|
2016-07-09 21:19:37 +02:00
|
|
|
# Infos persos
|
2016-05-21 23:57:36 +02:00
|
|
|
url(r'^profile$', 'gestioncof.views.profile'),
|
2016-06-08 22:28:38 +02:00
|
|
|
url(r'^outsider/password-change$',
|
2016-07-09 22:31:56 +02:00
|
|
|
'django.contrib.auth.views.password_change'),
|
2016-06-08 22:28:38 +02:00
|
|
|
url(r'^outsider/password-change-done$',
|
2016-06-09 01:58:03 +02:00
|
|
|
'django.contrib.auth.views.password_change_done',
|
|
|
|
name='password_change_done'),
|
2016-06-08 22:28:38 +02:00
|
|
|
# Inscription d'un nouveau membre
|
2016-05-21 23:57:36 +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-09 22:31:56 +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-09 22:31:56 +02:00
|
|
|
'gestioncof.views.registration_form2', name="user-registration"),
|
2016-06-08 22:28:38 +02:00
|
|
|
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-09 22:31:56 +02:00
|
|
|
url(r'^autocomplete/registration$',
|
|
|
|
'gestioncof.autocomplete.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-06-23 18:07:01 +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-09 22:31:56 +02:00
|
|
|
'gestioncof.csv_views.admin_list_export',
|
|
|
|
{'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-05-21 23:57:36 +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.
|