forked from DGNum/gestioCOF
117 lines
4.3 KiB
Python
117 lines
4.3 KiB
Python
|
"""
|
||
|
Fichier principal de configuration des urls du projet GestioCOF
|
||
|
"""
|
||
|
|
||
|
from django.conf import settings
|
||
|
from django.conf.urls import include, url
|
||
|
from django.conf.urls.static import static
|
||
|
from django.contrib import admin
|
||
|
from django.views.generic.base import TemplateView
|
||
|
from django.contrib.auth import views as django_views
|
||
|
from django_cas_ng import views as django_cas_views
|
||
|
|
||
|
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||
|
from wagtail.wagtailcore import urls as wagtail_urls
|
||
|
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||
|
|
||
|
from cof import views as cof_views, csv_views
|
||
|
from cof.urls import export_patterns, petitcours_patterns, \
|
||
|
surveys_patterns, events_patterns, calendar_patterns, \
|
||
|
clubs_patterns
|
||
|
from cof.autocomplete import autocomplete
|
||
|
|
||
|
admin.autodiscover()
|
||
|
|
||
|
urlpatterns = [
|
||
|
# Page d'accueil
|
||
|
url(r'^$', cof_views.home, name='home'),
|
||
|
# Le BdA
|
||
|
url(r'^bda/', include('bda.urls')),
|
||
|
# Les exports
|
||
|
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)),
|
||
|
# Calendrier
|
||
|
url(r'^calendar/', include(calendar_patterns)),
|
||
|
# Clubs
|
||
|
url(r'^clubs/', include(clubs_patterns)),
|
||
|
# Authentification
|
||
|
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$', cof_views.login_ext,
|
||
|
name="ext_login_view"),
|
||
|
url(r'^outsider/logout$', django_views.logout, {'next_page': 'home'}),
|
||
|
url(r'^login$', cof_views.login, name="cof-login"),
|
||
|
url(r'^logout$', cof_views.logout, name="cof-logout"),
|
||
|
# Infos persos
|
||
|
url(r'^profile$', cof_views.profile,
|
||
|
name='profile'),
|
||
|
url(r'^outsider/password-change$', django_views.password_change,
|
||
|
name='password_change'),
|
||
|
url(r'^outsider/password-change-done$',
|
||
|
django_views.password_change_done,
|
||
|
name='password_change_done'),
|
||
|
# Inscription d'un nouveau membre
|
||
|
url(r'^registration$', cof_views.registration,
|
||
|
name='registration'),
|
||
|
url(r'^registration/clipper/(?P<login_clipper>[\w-]+)/'
|
||
|
r'(?P<fullname>.*)$',
|
||
|
cof_views.registration_form2, name="clipper-registration"),
|
||
|
url(r'^registration/user/(?P<username>.+)$',
|
||
|
cof_views.registration_form2, name="user-registration"),
|
||
|
url(r'^registration/empty$', cof_views.registration_form2,
|
||
|
name="empty-registration"),
|
||
|
# Autocompletion
|
||
|
url(r'^autocomplete/registration$', autocomplete,
|
||
|
name="cof.registration.autocomplete"),
|
||
|
url(r'^user/autocomplete$', cof_views.user_autocomplete,
|
||
|
name='cof-user-autocomplete'),
|
||
|
# Interface admin
|
||
|
url(r'^admin/logout/', cof_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/',
|
||
|
csv_views.admin_list_export,
|
||
|
{'fields': ['username', ]}),
|
||
|
url(r'^admin/', include(admin.site.urls)),
|
||
|
# Liens utiles du COF et du BdA
|
||
|
url(r'^utile_cof$', cof_views.utile_cof,
|
||
|
name='utile_cof'),
|
||
|
url(r'^utile_bda$', cof_views.utile_bda,
|
||
|
name='utile_bda'),
|
||
|
url(r'^utile_bda/bda_diff$', cof_views.liste_bdadiff,
|
||
|
name="ml_diffbda"),
|
||
|
url(r'^utile_cof/diff_cof$', cof_views.liste_diffcof,
|
||
|
name='ml_diffcof'),
|
||
|
url(r'^utile_bda/bda_revente$', cof_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)),
|
||
|
# djconfig
|
||
|
url(r"^config", cof_views.ConfigUpdate.as_view(),
|
||
|
name='config.edit'),
|
||
|
]
|
||
|
|
||
|
if 'debug_toolbar' in settings.INSTALLED_APPS:
|
||
|
import debug_toolbar
|
||
|
urlpatterns += [
|
||
|
url(r'^__debug__/', include(debug_toolbar.urls)),
|
||
|
]
|
||
|
|
||
|
if settings.DEBUG:
|
||
|
# 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.
|
||
|
urlpatterns += static(settings.MEDIA_URL,
|
||
|
document_root=settings.MEDIA_ROOT)
|
||
|
|
||
|
# Wagtail for uncatched
|
||
|
urlpatterns += [
|
||
|
url(r'', include(wagtail_urls)),
|
||
|
]
|