paltman / shiftingbits

A Django Based Blog

This URL has Read+Write access

f79da0ab » paltman 2008-07-10 initial commit 1 from django.conf.urls.defaults import *
2 from shiftingbits.settings import MEDIA_ROOT
e7176af1 » paltman 2008-09-01 got admin working by correc... 3 from django.contrib import admin
2a6b09ac » paltman 2009-02-23 added a projects page 4 from django.views.generic.simple import direct_to_template
d529e160 » paltman 2008-09-05 got yearly archive working 5
6 from shiftingbits.blog.models import Post
97e13e08 » paltman 2008-12-24 updated some minor style tw... 7 from shiftingbits.blog.views import object_detail, archive_index, archive_month, archive_day, archive_year, object_detail_redirect, archive_day_redirect, archive_month_redirect
d529e160 » paltman 2008-09-05 got yearly archive working 8 from shiftingbits.blog.feeds import LatestPostFeed, LatestPostsByTagFeed
9
8ef7c9b7 » paltman 2008-12-31 enabled django mobile admin 10
e7176af1 » paltman 2008-09-01 got admin working by correc... 11 admin.autodiscover()
f79da0ab » paltman 2008-07-10 initial commit 12
8ef7c9b7 » paltman 2008-12-31 enabled django mobile admin 13 import mobileadmin
14 mobileadmin.autoregister()
15
16
d529e160 » paltman 2008-09-05 got yearly archive working 17 feeds = {
18 "latest": LatestPostFeed,
19 "tags": LatestPostsByTagFeed,
20 }
21
22 date_based_dict = {
f4dcb1c7 » paltman 2008-10-21 added daily archive templat... 23 "date_field": "pub_date"
d529e160 » paltman 2008-09-05 got yearly archive working 24 }
25
26 urlpatterns = patterns("",
219d6d08 » paltman 2008-09-07 added contrib.comments and ... 27 ### Feeds
29c10cf8 » paltman 2008-10-19 fixing import bug in urls 28 url(r"^rss.aspx", "shiftingbits.blog.views.feed_redirect"),
219d6d08 » paltman 2008-09-07 added contrib.comments and ... 29 url(r"^feeds/(?P<url>.*)/$", "django.contrib.syndication.views.feed", {"feed_dict": feeds}, name="blog_feeds"),
d529e160 » paltman 2008-09-05 got yearly archive working 30
219d6d08 » paltman 2008-09-07 added contrib.comments and ... 31 ### Tags
0384e65b » paltman 2008-09-07 added a message bar; enable... 32 url(r"tags/(?P<tag>[^/]+)/$", "tagging.views.tagged_object_list", { "queryset_or_model": Post, "template_object_name":"post", "template_name": "blog/post_archive.html", "related_tags": True}, name="blog_tag_detail"),
d529e160 » paltman 2008-09-05 got yearly archive working 33
34 ### Handle the way the old links were via redirect
46ae76ec » paltman 2008-09-06 got basic date-based generi... 35 url(r"^(?P<year>\d{4})/(?P<month>[0-9]*)/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$", object_detail_redirect),
36 url(r"^(?P<year>\d{4})/(?P<month>[0-9]*)/(?P<day>\w{1,2})/$", archive_day_redirect),
37 url(r"^(?P<year>\d{4})/(?P<month>[0-9]*)/$", archive_month_redirect),
219d6d08 » paltman 2008-09-07 added contrib.comments and ... 38
39 ### Date Based Generic Views for Blog Posts
40 url(r"^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[-\w]+)/$", object_detail, dict(date_based_dict, **{"template_object_name": "post"}), name="blog_post_detail"),
f4dcb1c7 » paltman 2008-10-21 added daily archive templat... 41 url(r"^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$", archive_day, dict(date_based_dict, **{"allow_empty": True}), name="blog_archive_daily"),
42 url(r"^(?P<year>\d{4})/(?P<month>[a-z]{3})/$", archive_month, dict(date_based_dict, **{"allow_empty":True}), name="blog_archive_month"),
43 url(r"^(?P<year>\d{4})/$", archive_year, dict(date_based_dict, **{"allow_empty":True}), name="blog_archive_year"),
0384e65b » paltman 2008-09-07 added a message bar; enable... 44 url(r'^$', archive_index, dict(date_based_dict, **{'template_object_name':'post_list'}), name="blog_archive"),
d529e160 » paltman 2008-09-05 got yearly archive working 45
219d6d08 » paltman 2008-09-07 added contrib.comments and ... 46 ### Comments
47 (r'^comments/', include('django.contrib.comments.urls')),
48
49 ### Admin
e7176af1 » paltman 2008-09-01 got admin working by correc... 50 (r'^admin/(.*)', admin.site.root),
219d6d08 » paltman 2008-09-07 added contrib.comments and ... 51
2a6b09ac » paltman 2009-02-23 added a projects page 52 ### Projects
53 (r'^projects/$', direct_to_template, {'template':'projects.html'}),
54
219d6d08 » paltman 2008-09-07 added contrib.comments and ... 55 ### Media
f79da0ab » paltman 2008-07-10 initial commit 56 (r'^media/(?P<path>.*)$' , 'django.views.static.serve', {'document_root': MEDIA_ROOT, 'show_indexes': True })
57 )
d529e160 » paltman 2008-09-05 got yearly archive working 58
bdcfb754 » paltman 2008-09-21 added some basic support fo... 59 from shiftingbits.blog.xmlrpc.urls import urlpatterns as xmlrpcpatterns
60
61 urlpatterns += xmlrpcpatterns
62
63
8ef7c9b7 » paltman 2008-12-31 enabled django mobile admin 64 urlpatterns += patterns('',
65 (r'^ma/(.*)', mobileadmin.sites.site.root),
66 )
67
68 handler404 = 'mobileadmin.views.page_not_found'
69 handler500 = 'mobileadmin.views.server_error'
70