Project

General

Profile

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

calebasse / calebasse / urls.py @ 0cbf950f

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
        patientrecord_resource, patientaddress_ressource)
9
from tastypie.api import Api
10

    
11
admin.autodiscover()
12

    
13
v1_api = Api(api_name="v1")
14
v1_api.register(act_ressource)
15
v1_api.register(event_resource)
16
v1_api.register(patientaddress_ressource)
17
v1_api.register(patientrecord_resource)
18

    
19
service_patterns = patterns('',
20
    url(r'^$', 'calebasse.views.homepage', name='homepage'),
21
    url(r'^agenda/', include('calebasse.agenda.urls')),
22
    url(r'^dossiers/', include('calebasse.dossiers.urls')),
23
    url(r'^actes/', include('calebasse.actes.urls')),
24
    url(r'^facturation/', include('calebasse.facturation.urls')),
25
    url(r'^personnes/', include('calebasse.personnes.urls')),
26
    url(r'^ressources/', include('calebasse.ressources.urls')),
27
)
28

    
29
urlpatterns = patterns('',
30
    # Examples:
31
    # url(r'^calebasse/', include('aps42.foo.urls')),
32

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

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

    
47
from django.conf import settings
48
if settings.DEBUG:
49
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
50
    urlpatterns += staticfiles_urlpatterns()
(10-10/14)