summaryrefslogtreecommitdiff
path: root/sublab_project/news/urls.py
blob: fbeb4f47346fbe7bde1d97ea964a5bd82b0c4564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from django.conf.urls.defaults import patterns, include, url
from django.views.generic import DetailView

from news.models import News
from news.feeds import NewsFeed, NewsFeedAtom
from news.views import NewsListView

urlpatterns = patterns('',
    url(r'^$', NewsListView.as_view(), name='news_list'),
    url(r'^rss/$', NewsFeed(), name='news_feed'),
    url(r'^atom/$', NewsFeedAtom(), name='news_feed_atom'),
    url(r'^(?P<slug>[-\w]+)/$', DetailView.as_view(model=News), name='news_detail'),
    url(r'^(?P<slug>[-\w]+)/image/$',
        DetailView.as_view(model=News, template_name='news/news_image.html'),
        name='news_image'),
)