kpsul/gestioCOF/urls.py
Martin Pépin 7967983b5c More sophisticated admin site for the gestion app
- Nested inlines
- Limiting access to the events : you can only edit/create events linked to
  associations you for which you have the `<assoc>.buro` permission.
2017-06-25 17:57:23 +01:00

96 lines
3.1 KiB
Python

# -*- coding: utf-8 -*-
"""
Fichier principal de configuration des urls du projet GestioCOF
"""
import gestion.urls
import kfet.urls
import bda.urls
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.contrib.auth import views as django_views
from cof import views as cof_views
from cof.urls import export_patterns, petitcours_patterns, \
surveys_patterns, calendar_patterns
from cof.autocomplete import autocomplete
from gestion import views as gestion_views
admin.autodiscover()
urlpatterns = [
# Page d'accueil
url(r'^$', cof_views.home, name='home'),
# The common views
url(r"^", include(gestion.urls, namespace="gestion")),
# Admin urls
url(r'^admin/logout/', gestion_views.logout),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', admin.site.urls),
# 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)),
# Calendrier
url(r'^calendar/', include(calendar_patterns)),
# Infos persos
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-]+)$',
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="autocomplete"),
url(r'^autocomplete/', include('autocomplete_light.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="liste_bdadiff"),
url(r'^utile_cof/diff_cof$',
cof_views.liste_diffcof,
name="liste_diffcof"),
url(r'^utile_bda/bda_revente$',
cof_views.liste_bdarevente,
name="liste_bdarevente"),
url(r'^k-fet/', include(kfet.urls)),
url(r"^_nested_admin/", include("nested_admin.urls")),
]
if 'debug_toolbar' in settings.INSTALLED_APPS:
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]
# 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)