1
|
from django.conf.urls import patterns, include, url
|
2
|
from django.views.generic.simple import redirect_to
|
3
|
from django.contrib import admin
|
4
|
from django.contrib.auth.decorators import login_required
|
5
|
|
6
|
from urls_utils import decorated_includes
|
7
|
|
8
|
from calebasse.api import EventResource, OccurrenceResource
|
9
|
|
10
|
admin.autodiscover()
|
11
|
|
12
|
event_resource = EventResource()
|
13
|
occurrence_resource = OccurrenceResource()
|
14
|
|
15
|
service_patterns = patterns('',
|
16
|
url(r'^$', 'calebasse.views.homepage', name='homepage'),
|
17
|
url(r'^agenda/', include('calebasse.agenda.urls')),
|
18
|
url(r'^dossiers/', include('calebasse.dossiers.urls')),
|
19
|
url(r'^actes/', include('calebasse.actes.urls')),
|
20
|
url(r'^facturation/', include('calebasse.facturation.urls')),
|
21
|
url(r'^personnes/', include('calebasse.personnes.urls')),
|
22
|
url(r'^ressources/', include('calebasse.ressources.urls')),
|
23
|
)
|
24
|
|
25
|
urlpatterns = patterns('',
|
26
|
# Examples:
|
27
|
# url(r'^calebasse/', include('aps42.foo.urls')),
|
28
|
|
29
|
# Uncomment the admin/doc line below to enable admin documentation:
|
30
|
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
31
|
|
32
|
(r'^$', 'calebasse.views.redirect_to_homepage'),
|
33
|
url(r'^admin/', include(admin.site.urls)),
|
34
|
url(r'^accounts/logout/', 'django.contrib.auth.views.logout_then_login'),
|
35
|
url(r'^accounts/', include('django.contrib.auth.urls')),
|
36
|
url(r'^api/',
|
37
|
decorated_includes(login_required, include(event_resource.urls))),
|
38
|
url(r'^api/',
|
39
|
decorated_includes(login_required, include(occurrence_resource.urls)),
|
40
|
),
|
41
|
url(r'^(?P<service>[a-z-]+)/', decorated_includes(login_required,
|
42
|
include(service_patterns))),
|
43
|
url(r'^lookups/', include('ajax_select.urls')),
|
44
|
)
|