Commit c6c486be authored by chris's avatar chris

flyers/urls: use new syntax

parent d890ceef
from django.conf.urls import patterns, include, url
from django.conf.urls import include, url
from django.views.generic import TemplateView
from django.views.generic import DetailView
from django.shortcuts import get_object_or_404
......@@ -15,7 +15,7 @@ class HomepageDetail(DetailView):
return get_object_or_404(Page, pk=settings.home_page.pk)
return None
urlpatterns = patterns('',
urlpatterns = [
# Examples:
# url(r'^$', 'flyers.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
......@@ -24,12 +24,12 @@ urlpatterns = patterns('',
(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^$', HomepageDetail.as_view()),
url(r'^(?P<slug>.+)/$', DetailView.as_view(model=Page)),
)
]
import settings
if settings.DEBUG:
urlpatterns += patterns('',
urlpatterns += [
url(r'^media/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, }),
)
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment