aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django/urls.py
blob: d9eb6cedb81d16dcf09484f296bf0ba7c78418e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from django.conf.urls.defaults import *
from photos.models import Photo
from django.contrib.comments.models import Comment,FreeComment
import git_wiki.models

urlpatterns = patterns('',
    # Example:
    # (r'^bn_django/', include('bn_django.foo.urls')),
    (r'^$',             'django.views.generic.simple.direct_to_template', 
        {'template': 'frontpage.html','extra_context':dict({ \
        'latest_photos':Photo.objects.order_by('-date')[:2], \
        #'latest_comments':Photo.objects.order_by('date')[:4] \
        'latest_knowledge':git_wiki.models.shortlog(), \
        'latest_comments':Comment.objects.order_by('-submit_date')[:4], \
        'latest_freecomments': \
            FreeComment.objects.order_by('-submit_date')[:4], \
        'newitems':git_wiki.models.newest_items(), \
        })}),
    (r'^about/$', 'django.views.generic.simple.direct_to_template', 
        {'template': 'about.html'}),
    (r'^credits/$', 'django.views.generic.simple.direct_to_template', 
        {'template': 'credits.html'}),
    (r'^copyright/$', 'django.views.generic.simple.direct_to_template', 
        {'template': 'copyright.html'}),

    (r'^knowledge/$', 'bn_django.git_wiki.views.frontpage',),
    (r'^k/', include('bn_django.git_wiki.urls')),
    (r'^code/', include('bn_django.git_browse.urls')),
    (r'^photos/', include('bn_django.photos.urls')),
    
    (r'^search/', include('bn_django.search.urls')),

    # Uncomment this for admin:
     (r'^admin/', include('django.contrib.admin.urls')),
     (r'^comments/', include('django.contrib.comments.urls.comments')),

    (r'^static/(?P<path>.*)$', 'django.views.static.serve', 
        {'document_root': '/home/bnewbold/bn-project/static', 
         'show_indexes': True}),
    (r'^style/(?P<path>.*)$', 'django.views.static.serve', 
        {'document_root': '/home/bnewbold/bn-project/static/style'}),
    (r'^media/(?P<path>.*)$', 'django.views.static.serve', 
        {'document_root': '/home/bnewbold/bn-project/media'}),
)