urls.py 3.38 KB
Newer Older
Gabriel Detraz's avatar
Gabriel Detraz committed
1
# -*- mode: python; coding: utf-8 -*-
lhark's avatar
lhark committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Re2o est un logiciel d'administration développé initiallement au rezometz. Il
# se veut agnostique au réseau considéré, de manière à être installable en
# quelques clics.
#
# Copyright © 2017  Gabriel Détraz
# Copyright © 2017  Goulven Kermarec
# Copyright © 2017  Augustin Lemesle
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

chirac's avatar
chirac committed
24
25
26
27
28
29
30
"""re2o URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
Maël Kervella's avatar
Maël Kervella committed
31
32
33
    2. Add a URL to urlpatterns:  url(r'^$', views.home)
    3. Optional: Add a custom name for this URL:
         url(r'^$', views.home, name='home')
chirac's avatar
chirac committed
34
35
Class-based views
    1. Add an import:  from other_app.views import Home
Maël Kervella's avatar
Maël Kervella committed
36
37
38
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view())
    3. Optional: Add a custom name for this URL:
         url(r'^$', Home.as_view(), name='home')
chirac's avatar
chirac committed
39
40
Including another URLconf
    1. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
Maël Kervella's avatar
Maël Kervella committed
41
42
    2. Optional: Add a custom namespace for all URL using this urlpatterns:
         url(r'^blog/', include('blog.urls'), namespace='blog')
chirac's avatar
chirac committed
43
"""
44
45
from __future__ import unicode_literals

Maël Kervella's avatar
Maël Kervella committed
46
from django.conf import settings
chirac's avatar
chirac committed
47
48
from django.conf.urls import include, url
from django.contrib import admin
lhark's avatar
lhark committed
49
from django.contrib.auth import views as auth_views
chirac's avatar
chirac committed
50

Grizzly's avatar
Grizzly committed
51
from .views import index, about_page, contact_page
52

Maël Kervella's avatar
Maël Kervella committed
53
handler500 = 're2o.views.handler500'
54
handler404 = 're2o.views.handler404'
Maël Kervella's avatar
Maël Kervella committed
55

chirac's avatar
chirac committed
56
urlpatterns = [
57
    url(r'^$', index, name='index'),
58
    url(r'^about/$', about_page, name='about'),
Grizzly's avatar
Grizzly committed
59
    url(r'^contact/$', contact_page, name='contact'),
lhark's avatar
lhark committed
60
61
    url('^logout/', auth_views.logout, {'next_page': '/'}),
    url('^', include('django.contrib.auth.urls')),
Maël Kervella's avatar
Maël Kervella committed
62
    url(r'^i18n/', include('django.conf.urls.i18n')),
63
64
65
    url(r'^admin/', include(admin.site.urls)),
    url(r'^users/', include('users.urls', namespace='users')),
    url(r'^search/', include('search.urls', namespace='search')),
chirac's avatar
chirac committed
66
67
68
69
    url(
        r'^cotisations/',
        include('cotisations.urls', namespace='cotisations')
    ),
70
71
72
    url(r'^machines/', include('machines.urls', namespace='machines')),
    url(r'^topologie/', include('topologie.urls', namespace='topologie')),
    url(r'^logs/', include('logs.urls', namespace='logs')),
chirac's avatar
chirac committed
73
74
75
76
    url(
        r'^preferences/',
        include('preferences.urls', namespace='preferences')
    ),
chirac's avatar
chirac committed
77
]
78
79
80
81
82
83
# Add debug_toolbar URLs if activated
if 'debug_toolbar' in settings.INSTALLED_APPS:
    import debug_toolbar
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ]
Maël Kervella's avatar
Maël Kervella committed
84
85
86
87
if 'api' in settings.INSTALLED_APPS:
    urlpatterns += [
        url(r'^api/', include('api.urls', namespace='api')),
    ]