1 | from django.conf.urls.defaults import * |
---|
2 | from django.contrib.auth.views import login |
---|
3 | |
---|
4 | import settings |
---|
5 | |
---|
6 | # Necessary views |
---|
7 | import finance_core.views |
---|
8 | |
---|
9 | # Uncomment the next two lines to enable the admin: |
---|
10 | from django.contrib import admin |
---|
11 | admin.autodiscover() |
---|
12 | |
---|
13 | urlpatterns = patterns('', |
---|
14 | # Example: |
---|
15 | (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'index.html'}), |
---|
16 | (r'^vouchers/', include('vouchers.urls')), |
---|
17 | (r'^finance_core/', include('finance_core.urls')), |
---|
18 | |
---|
19 | # Uncomment the admin/doc line below and add 'django.contrib.admindocs' |
---|
20 | # to INSTALLED_APPS to enable admin documentation: |
---|
21 | (r'^admin/doc/', include('django.contrib.admindocs.urls')), |
---|
22 | |
---|
23 | # Uncomment the next line to enable the admin: |
---|
24 | (r'^admin/(.*)', admin.site.root), |
---|
25 | (r'^accounts/login/', login, ), |
---|
26 | ) |
---|
27 | |
---|
28 | if settings.DEBUG: |
---|
29 | from django.views.static import serve |
---|
30 | _media_url = settings.MEDIA_URL |
---|
31 | if _media_url.startswith('/'): |
---|
32 | _media_url = _media_url[1:] |
---|
33 | urlpatterns += patterns('', |
---|
34 | (r'^%s(?P<path>.*)$' % _media_url, |
---|
35 | serve, |
---|
36 | {'document_root': settings.MEDIA_ROOT})) |
---|
37 | del(_media_url, serve) |
---|