From 843e7e06709a35a162ddb28e9eef528870e2c0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Wed, 20 Jun 2018 15:12:45 +0300 Subject: added urls for rss feeds --- weblog/urls.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'weblog/urls.py') 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[0-9]{4})/(?P[0-9]{1,2})/$', views.Index, name='ArchiveIndex'), url(r'^(?P[-\w]+)/$', views.Index, name='CategoryIndex'), url(r'^(?P[-\w]+)/(?P[-\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[-\w]+)/rss/$', BlogFeed(), name='CategoryRSS'), + ] -- cgit v1.2.3 From 06b58a6a3afbe3e9ffac45b363cfeafcf0e4b3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Wed, 20 Jun 2018 16:14:20 +0300 Subject: rss bug fixes --- weblog/urls.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'weblog/urls.py') diff --git a/weblog/urls.py b/weblog/urls.py index 4d6a325..b3e95b1 100755 --- a/weblog/urls.py +++ b/weblog/urls.py @@ -4,7 +4,16 @@ from weblog.feeds import BlogFeed from weblog.apps import SETTINGS as blog_settings app_name = 'weblog' -urlpatterns = [ + +urlpatterns = [] + +if blog_settings['enable_rss']: + urlpatterns += [ + url(r'^rss/$', BlogFeed(), name='RSS'), + url(r'^(?P[-\w]+)/rss/$', BlogFeed(), name='CategoryRSS'), + ] + +urlpatterns += [ url(r'^$', views.Index, name='Index'), url(r'^change-language/(?P[-\w]+)/$', views.ChangeLanguage, name='ChangeLanguage'), url(r'^(?P[0-9]{4})/$', views.Index, name='ArchiveIndex'), @@ -12,9 +21,3 @@ urlpatterns = [ url(r'^(?P[-\w]+)/$', views.Index, name='CategoryIndex'), url(r'^(?P[-\w]+)/(?P[-\w]+)/$', views.PostView, name='PostView'), ] - -if blog_settings['enable_rss']: - urlpatters += [ - url(r'^/rss/$', BlogFeed(), name='RSS'), - url(r'^/(?P[-\w]+)/rss/$', BlogFeed(), name='CategoryRSS'), - ] -- cgit v1.2.3