gramps/src/web/urls.py
Doug Blank f90c2db4cd Moved src/gen/web to src/web
svn: r13547
2009-11-10 14:23:19 +00:00

38 lines
998 B
Python

import os
import const
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
from web.grampsdb.views import (main_page, user_page, logout_page,
view, view_detail)
urlpatterns = patterns('',
# Specific matches first:
(r'^admin/(.*)', admin.site.root),
)
urlpatterns += patterns('',
# Static serves! DANGEROUS in production:
(r'^styles/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': const.DATA_DIR,
'show_indexes': True},
),
(r'^images/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': const.IMAGE_DIR,
'show_indexes': True},
),
)
# The rest will match views:
urlpatterns += patterns('',
(r'^$', main_page),
(r'^user/(\w+)/$', user_page),
(r'^login/$', 'django.contrib.auth.views.login'),
(r'^logout/$', logout_page),
(r'^(?P<view>(\w+))/$', view),
(r'^(?P<view>(\w+))/(?P<handle>(\w+))/$', view_detail),
)