1. Colin Copeland
  2. caktus-django-template

Source

caktus-django-template / caktus_django_template / features / urls.py

from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin


admin.autodiscover()

handler404 = 'PROJECT_NAME.views.page_not_found'
handler500 = 'PROJECT_NAME.views.server_error'

urlpatterns = patterns('',
    (r'^%sadmin/' % settings.URL_PREFIX, include(admin.site.urls)),
    (r'^%streenav/' % settings.URL_PREFIX, include('treenav.urls.admin')),
    (r'^%srobots.txt$' % settings.URL_PREFIX, include('robots.urls')),
)


if getattr(settings, 'SERVE_STATIC_MEDIA', False):
    urlpatterns += patterns('', (
            r'^%s(?P<path>.*)' % settings.MEDIA_URL.lstrip('/'),
            'django.views.static.serve',
            {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}
        )
    )
    
urlpatterns += patterns('',
    (r'^%spagelets/' % settings.URL_PREFIX, include('pagelets.urls.management')),
    (r'^%s' % settings.URL_PREFIX, include('pagelets.urls.content')),
)