spark-eol/urls.py

24 строки
689 B
Python
Исходник Обычный вид История

2011-05-18 19:25:42 +04:00
from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'', include('commons.urls')),
(r'^', include('eol.urls')),
)
# Handle 404 and 500 errors
handler404 = 'commons.views.handle404'
handler500 = 'commons.views.handle500'
## In DEBUG mode, serve media files through Django.
if settings.DEBUG:
# Remove leading and trailing slashes so the regex matches.
media_url = settings.MEDIA_URL.lstrip('/').rstrip('/')
urlpatterns += patterns('',
(r'^%s/(?P<path>.*)$' % media_url, 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)