diff options
author | Yaroslav de la Peña Smirnov <contact@yaroslavps.com> | 2018-06-20 15:12:45 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <contact@yaroslavps.com> | 2018-06-20 15:12:45 +0300 |
commit | 843e7e06709a35a162ddb28e9eef528870e2c0f6 (patch) | |
tree | d6f0a615fcdf51c49993e38d9eebcdc77ef317e7 /weblog/urls.py | |
parent | 812fbefe190a4a9d4f5250ba39411a50e9167448 (diff) | |
download | w3blog-843e7e06709a35a162ddb28e9eef528870e2c0f6.tar.gz w3blog-843e7e06709a35a162ddb28e9eef528870e2c0f6.zip |
added urls for rss feeds
Diffstat (limited to 'weblog/urls.py')
-rwxr-xr-x | weblog/urls.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/weblog/urls.py b/weblog/urls.py index 643e8c7..4d6a325 100755 --- a/weblog/urls.py +++ b/weblog/urls.py @@ -1,5 +1,7 @@ from django.conf.urls import url
from . import views
+from weblog.feeds import BlogFeed
+from weblog.apps import SETTINGS as blog_settings
app_name = 'weblog'
urlpatterns = [
@@ -9,4 +11,10 @@ urlpatterns = [ url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{1,2})/$', views.Index, name='ArchiveIndex'),
url(r'^(?P<category_slug>[-\w]+)/$', views.Index, name='CategoryIndex'),
url(r'^(?P<category_slug>[-\w]+)/(?P<post_slug>[-\w]+)/$', views.PostView, name='PostView'),
-]
\ No newline at end of file +]
+
+if blog_settings['enable_rss']:
+ urlpatters += [
+ url(r'^/rss/$', BlogFeed(), name='RSS'),
+ url(r'^/(?P<category_slug>[-\w]+)/rss/$', BlogFeed(), name='CategoryRSS'),
+ ]
|