Project

General

Profile

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

calebasse / calebasse / urls.py @ 78bae9a3

1 111b2d34 Benjamin Dauvergne
from django.conf.urls import patterns, include, url
2 42670aa4 Jérôme Schneider
from django.contrib import admin
3 7b28c0b2 Benjamin Dauvergne
from django.contrib.auth.decorators import login_required
4
5
from urls_utils import decorated_includes
6
7 9123ecac Jérôme Schneider
from calebasse.api import (act_ressource, event_resource,
8 5feec0ab Jérôme Schneider
        eventwithact_resource, patientrecord_resource,
9
        patientaddress_ressource)
10 9123ecac Jérôme Schneider
from tastypie.api import Api
11 1a622a74 Jérôme Schneider
12 42670aa4 Jérôme Schneider
admin.autodiscover()
13 111b2d34 Benjamin Dauvergne
14 9123ecac Jérôme Schneider
v1_api = Api(api_name="v1")
15
v1_api.register(act_ressource)
16
v1_api.register(event_resource)
17 5feec0ab Jérôme Schneider
v1_api.register(eventwithact_resource)
18 9123ecac Jérôme Schneider
v1_api.register(patientaddress_ressource)
19
v1_api.register(patientrecord_resource)
20 1a622a74 Jérôme Schneider
21 e59e5bc3 Benjamin Dauvergne
service_patterns = patterns('',
22 26cb36f6 Benjamin Dauvergne
    url(r'^$', 'calebasse.views.homepage', name='homepage'),
23 e59e5bc3 Benjamin Dauvergne
    url(r'^agenda/', include('calebasse.agenda.urls')),
24 1097fd0a Benjamin Dauvergne
    url(r'^dossiers/', include('calebasse.dossiers.urls')),
25
    url(r'^actes/', include('calebasse.actes.urls')),
26 e59e5bc3 Benjamin Dauvergne
    url(r'^facturation/', include('calebasse.facturation.urls')),
27 1097fd0a Benjamin Dauvergne
    url(r'^personnes/', include('calebasse.personnes.urls')),
28 e59e5bc3 Benjamin Dauvergne
    url(r'^ressources/', include('calebasse.ressources.urls')),
29 330dad49 Mikaël Ates
    url(r'^statistics/', include('calebasse.statistics.urls')),
30 78bae9a3 Jérôme Schneider
    url(r'^select2/', include('django_select2.urls')),
31 e59e5bc3 Benjamin Dauvergne
)
32
33 111b2d34 Benjamin Dauvergne
urlpatterns = patterns('',
34
    # Examples:
35 333a39ca Benjamin Dauvergne
    # url(r'^calebasse/', include('aps42.foo.urls')),
36 111b2d34 Benjamin Dauvergne
37
    # Uncomment the admin/doc line below to enable admin documentation:
38
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
39
40 2e9ee32b Benjamin Dauvergne
    (r'^$', 'calebasse.views.redirect_to_homepage'),
41 42670aa4 Jérôme Schneider
    url(r'^admin/', include(admin.site.urls)),
42 65103a73 Benjamin Dauvergne
    url(r'^accounts/logout/', 'django.contrib.auth.views.logout_then_login'),
43 26cb36f6 Benjamin Dauvergne
    url(r'^accounts/', include('django.contrib.auth.urls')),
44 5c66ef04 Jérôme Schneider
    url(r'^api/',
45 9123ecac Jérôme Schneider
        decorated_includes(login_required, include(v1_api.urls))),
46 7b28c0b2 Benjamin Dauvergne
    url(r'^(?P<service>[a-z-]+)/', decorated_includes(login_required,
47
        include(service_patterns))),
48
    url(r'^lookups/', include('ajax_select.urls')),
49 111b2d34 Benjamin Dauvergne
)
50 85657e39 Thomas NOEL
51
from django.conf import settings
52
if settings.DEBUG:
53
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
54
    urlpatterns += staticfiles_urlpatterns()