forked from PyAr/pyarweb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathurls.py
31 lines (29 loc) · 1.2 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from django.contrib.auth.decorators import login_required
from django.views.generic.detail import DetailView
from django.conf.urls import patterns, url
from .models import NewsArticle
from .views import (
NewsArticleCreate,
NewsArticleDelete,
NewsArticleList,
NewsArticleUpdate,
NewsFeed
)
urlpatterns = patterns('',
url(r'^$', NewsArticleList.as_view(),
name='news_list_all'),
url(r'^rss$', NewsFeed(),
name='news_feed'),
url(r'^add/$',
login_required(NewsArticleCreate.as_view()),
name='news_add'),
url(r'^(?P<pk>\d+)/$',
DetailView.as_view(model=NewsArticle),
name='news_view'),
url(r'^(?P<pk>\d+)/delete/$',
login_required(NewsArticleDelete.as_view()),
name='news_delete'),
url(r'^(?P<pk>\d+)/update/$',
login_required(NewsArticleUpdate.as_view()),
name='news_update'),
)