Project

General

Profile

Download (2.02 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / urls.py @ 78bae9a3

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
    url(r'^select2/', include('django_select2.urls')),
31
)
32

    
33
urlpatterns = patterns('',
34
    # Examples:
35
    # url(r'^calebasse/', include('aps42.foo.urls')),
36

    
37
    # Uncomment the admin/doc line below to enable admin documentation:
38
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
39

    
40
    (r'^$', 'calebasse.views.redirect_to_homepage'),
41
    url(r'^admin/', include(admin.site.urls)),
42
    url(r'^accounts/logout/', 'django.contrib.auth.views.logout_then_login'),
43
    url(r'^accounts/', include('django.contrib.auth.urls')),
44
    url(r'^api/',
45
        decorated_includes(login_required, include(v1_api.urls))),
46
    url(r'^(?P<service>[a-z-]+)/', decorated_includes(login_required,
47
        include(service_patterns))),
48
    url(r'^lookups/', include('ajax_select.urls')),
49
)
50

    
51
from django.conf import settings
52
if settings.DEBUG:
53
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
54
    urlpatterns += staticfiles_urlpatterns()
(13-13/17)