Source

byteflow / urls.py

Full commit
# Custom patches
import patches

from os.path import join, dirname

from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template, redirect_to
from django.conf import settings
from django.contrib import admin
from django.contrib.sitemaps import FlatPageSitemap

from blog.sitemaps import BlogSitemap

sitemaps = {
    'blog': BlogSitemap,
    'flat': FlatPageSitemap,
    }

try:
    import urls_local
    urlpatterns = urls_local.urlpatterns
except ImportError:
    urlpatterns = patterns('',)

urlpatterns += patterns(
    '',
    url(r'^admin/', include('django.contrib.admin.urls')),
    url(r'^accounts/', include('accounts.urls')),
    url(r'^openid/', include('openidconsumer.urls')),
    url(r'^openidserver/', include('openidserver.urls')),
    url(r'^%s' % settings.BLOG_URLCONF_ROOT, include('blog.urls')),
    url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
    url(r'^pingback/', include('pingback.urls')),
    url(r'^$', 'blog.views.process_root_request'),
    url(r'^captcha/', include('captcha.urls')),
    url(r'^robots.txt$', include('robots.urls')),
    url(r'^feeds/', include('feed.urls')),
    )

# static urls will be disabled in production mode,
# forcing user to configure httpd
if settings.DEBUG:
    urlpatterns += patterns(
        '',
        url(r'^media/(.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
        url(r'^static/(.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
        url(r'^admin-media/(.*)$', 'django.views.static.serve', {'document_root': join(dirname(admin.__file__), 'media')}),
        )

if 'wpimport' in settings.INSTALLED_APPS:
    urlpatterns += patterns(
        '',
        url(r'^wpimport/', include('wpimport.urls')),
        )

if 'wbimport' in settings.INSTALLED_APPS:
    urlpatterns += patterns(
        '',
        url(r'^wbimport/', include('wbimport.urls')),
        )