changelog shortlog tags changeset files revisions annotate raw

web/urls.py

changeset 169: ab75cee55c5c
parent:21a2032d97e7
author: Jason Moiron <jmoiron@jmoiron.net>
date: Wed Jul 28 22:44:11 2010 -0400 (10 hours ago)
permissions: -rw-r--r--
description: start v4design branch; just not satisfied with the dark theme
1#!/usr/bin/env python
2
3"""jmoiron.net's master urls.py
4
5Implicit in my website are the fact that the following flatpages will exist
6and that the FlatpageFallbackMiddleware is installed and working properly:
7 /about/ -- the classic 'about' page
8 /code/ -- my overview of code
9 /docs/ -- my overview of various documentation
10 /gallery/ *** temporary static page for gallery app ***
11
12If FlatPage objects are not showing up, you might want to check the SITE_ID
13in settings.py/local_settings.py.
14
15The following redirects have to be made to keep old links working:
16 /rant/?id=#
17 /links/
18 /images/...
19"""
20
21from django.contrib import admin
22from django.conf import settings
23from django.conf.urls.defaults import include, handler500, handler404
24
25from saudade.common.shortcuts import generics
26from saudade.blog.feeds import BlogFeed
27from saudade.comments.feeds import CommentFeed, CommentLogFeed
28import dselector
29
30feeds = {
31 'blog' : BlogFeed,
32 'comments' : CommentFeed,
33 'comments/log' : CommentLogFeed,
34}
35
36admin.autodiscover()
37
38images = '/media/legacy/images/'
39media = lambda x: '/media/' + x
40
41
42parser = dselector.Parser()
43urlpatterns = parser.patterns('',
44 (r'rss/{url:any}/', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
45 (r'admin/(.*)!', admin.site.root),
46 (r'login/!', 'saudade.common.views.login_view'),
47 (r'logout/!', 'saudade.common.views.logout_view'),
48 (r'tags/!', include('saudade.tagging.urls')),
49 (r'blog/!', include('saudade.blog.urls')),
50 (r'todo/!', include('saudade.todo.urls')),
51 (r'womfa/!', include('saudade.womfa.urls')),
52 (r'linkpost/!', include('saudade.linkpost.urls')),
53 (r'comments/!', include('saudade.comments.urls')),
54 (r'', generics.redirect, {'url': '/blog/'}),
55 (r'links?/!', generics.redirect, {'url': '/about/'}),
56 (r'rant/', 'saudade.blog.views.legacy_blog'),
57 (r'images/', generics.redirect, {'url': images}),
58 (r'images/{arg:any}/', generics.redirect, {'url': images + '%(arg)s'}),
59 # static stuff
60 (r'robots.txt', generics.redirect, {'url': media('robots.txt')}),
61 (r'favicon.ico', generics.redirect, {'url': media('favicon.ico')}),
62 (r'favicon.gif', generics.redirect, {'url': media('favicon.gif')}),
63 (r'favicon.png', generics.redirect, {'url': media('favicon.png')}),
64)
65
66if settings.DEBUG:
67 urlpatterns += parser.patterns('',
68 (r'media/{path:any}', 'django.views.static.serve', {'document_root': './media/'}),
69 )
70