1
|
from django.conf.urls import patterns, include, url
|
2
|
from django.contrib import admin
|
3
|
from django.contrib.auth.decorators import login_required
|
4
|
|
5
|
from urls_utils import decorated_includes
|
6
|
|
7
|
from calebasse.api import (act_ressource, event_resource,
|
8
|
eventwithact_resource, patientrecord_resource,
|
9
|
patientaddress_ressource)
|
10
|
from tastypie.api import Api
|
11
|
|
12
|
admin.autodiscover()
|
13
|
|
14
|
v1_api = Api(api_name="v1")
|
15
|
v1_api.register(act_ressource)
|
16
|
v1_api.register(event_resource)
|
17
|
v1_api.register(eventwithact_resource)
|
18
|
v1_api.register(patientaddress_ressource)
|
19
|
v1_api.register(patientrecord_resource)
|
20
|
|
21
|
service_patterns = patterns('',
|
22
|
url(r'^$', 'calebasse.views.homepage', name='homepage'),
|
23
|
url(r'^agenda/', include('calebasse.agenda.urls')),
|
24
|
url(r'^dossiers/', include('calebasse.dossiers.urls')),
|
25
|
url(r'^actes/', include('calebasse.actes.urls')),
|
26
|
url(r'^facturation/', include('calebasse.facturation.urls')),
|
27
|
url(r'^personnes/', include('calebasse.personnes.urls')),
|
28
|
url(r'^ressources/', include('calebasse.ressources.urls')),
|
29
|
url(r'^statistics/', include('calebasse.statistics.urls')),
|
30
|
)
|
31
|
|
32
|
urlpatterns = patterns('',
|
33
|
# Examples:
|
34
|
# url(r'^calebasse/', include('aps42.foo.urls')),
|
35
|
|
36
|
# Uncomment the admin/doc line below to enable admin documentation:
|
37
|
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
38
|
|
39
|
(r'^$', 'calebasse.views.redirect_to_homepage'),
|
40
|
url(r'^admin/', include(admin.site.urls)),
|
41
|
url(r'^accounts/logout/', 'django.contrib.auth.views.logout_then_login'),
|
42
|
url(r'^accounts/', include('django.contrib.auth.urls')),
|
43
|
url(r'^api/',
|
44
|
decorated_includes(login_required, include(v1_api.urls))),
|
45
|
url(r'^(?P<service>[a-z-]+)/', decorated_includes(login_required,
|
46
|
include(service_patterns))),
|
47
|
url(r'^lookups/', include('ajax_select.urls')),
|
48
|
)
|
49
|
|
50
|
from django.conf import settings
|
51
|
if settings.DEBUG:
|
52
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
53
|
urlpatterns += staticfiles_urlpatterns()
|