Code

Ticket #9678: urls.py

File urls.py, 868 bytes (added by watusee, 5 years ago)

urls.py

Line 
1from django.conf.urls.defaults import *
2from django.contrib import admin
3from watusee.work.models import Project
4
5admin.autodiscover()
6
7work_dict= {
8    'queryset': Project.objects.all(),
9    'extra_context' : {
10        'worksnav' : Project.objects.filter(publish=True),
11    }
12}
13
14urlpatterns = patterns('',
15#    (r'^works/$', 'django.views.generic.list_detail.object_list', dict(work_dict, template_name='works.html', template_object_name='works')),
16    (r'^works/(?P<slug>[-\w]+)/$', 'django.views.generic.list_detail.object_detail', dict(work_dict, slug_field='slug', template_name='work.html', template_object_name='work')),
17    (r'^admin/(.*)', admin.site.root),
18    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/home2/mainderay/webapps/site_media/'}),
19    (r'', include('django.contrib.flatpages.urls')),
20
21)