From cd98a4f09f4d6a7676b9c4685ac9805a93533c0a Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Sun, 18 Jan 2009 00:34:21 -0500 Subject: urls.py is site specific --- .gitignore | 1 + bn_django/urls.py | 50 ---------------------------------------------- bn_django/urls.py.example | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 50 deletions(-) delete mode 100644 bn_django/urls.py create mode 100644 bn_django/urls.py.example diff --git a/.gitignore b/.gitignore index cbc3bd2..dbae627 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ media code bn_django/bn_django.db bn_django/settings.py +bn_django/urls.py bn_django/git_wiki/settings.py bn_django/git_browse/settings.py *.pyc diff --git a/bn_django/urls.py b/bn_django/urls.py deleted file mode 100644 index fa8b083..0000000 --- a/bn_django/urls.py +++ /dev/null @@ -1,50 +0,0 @@ -from django.conf.urls.defaults import * -from photos.models import Photo -from django.contrib.comments.models import Comment -from django.contrib import admin -import git_wiki.models - -admin.autodiscover() - -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')[:8], \ - '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/$', 'django.views.generic.simple.direct_to_template', - # {'template': 'nogo.html'}), - (r'^k/', include('bn_django.git_wiki.urls')), - (r'^code/$', 'django.views.generic.simple.direct_to_template', - {'template': 'nogo.html'}), - #(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/doc/', include('django.contrib.admindocs.urls')), - (r'^admin/(.*)', admin.site.root), - (r'^comments/', include('django.contrib.comments.urls')), - - (r'^static/(?P.*)$', 'django.views.static.serve', - {'document_root': '/home/bnewbold/bn-project/static', - 'show_indexes': True}), - (r'^style/(?P.*)$', 'django.views.static.serve', - {'document_root': '/home/bnewbold/bn-project/static/style'}), - (r'^media/(?P.*)$', 'django.views.static.serve', - {'document_root': '/home/bnewbold/bn-project/media'}), -) diff --git a/bn_django/urls.py.example b/bn_django/urls.py.example new file mode 100644 index 0000000..aa9e079 --- /dev/null +++ b/bn_django/urls.py.example @@ -0,0 +1,51 @@ +from django.conf.urls.defaults import * +from photos.models import Photo +from django.contrib.comments.models import Comment +from django.contrib import admin +import git_wiki.models + +admin.autodiscover() + +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')[:8], \ + '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/$', 'django.views.generic.simple.direct_to_template', + # {'template': 'nogo.html'}), + (r'^k/', include('bn_django.git_wiki.urls')), + (r'^code/$', 'django.views.generic.simple.direct_to_template', + {'template': 'nogo.html'}), + #(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/doc/', include('django.contrib.admindocs.urls')), + (r'^admin/(.*)', admin.site.root), + (r'^comments/', include('django.contrib.comments.urls')), + + # uncomment for development + #(r'^static/(?P.*)$', 'django.views.static.serve', + # {'document_root': '/home/bnewbold/code/bn-project/static', + # 'show_indexes': True}), + #(r'^style/(?P.*)$', 'django.views.static.serve', + # {'document_root': '/home/bnewbold/code/bn-project/static/style'}), + #(r'^media/(?P.*)$', 'django.views.static.serve', + # {'document_root': '/home/bnewbold/code/bn-project/media'}), +) -- cgit v1.2.3