From 345ab6ec1eb5a21521d379239cc1d6f85edb1ba3 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Wed, 30 Dec 2020 14:54:22 +0100 Subject: [PATCH] Move articles urls to their own file --- articles/urls.py | 11 +++++++++++ blog/urls.py | 9 ++------- 2 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 articles/urls.py diff --git a/articles/urls.py b/articles/urls.py new file mode 100644 index 0000000..6e802a4 --- /dev/null +++ b/articles/urls.py @@ -0,0 +1,11 @@ +from django.urls import path + +from articles.views import api, feeds, html + +urlpatterns = [ + path("", html.ArticlesListView.as_view(), name="articles-list"), + path("drafts/", html.DraftsListView.as_view(), name="drafts-list"), + path("feed/", feeds.CompleteFeed(), name="complete-feed"), + path("api/render//", api.render_article, name="api-render-article"), + path("/", html.ArticleDetailView.as_view(), name="article-detail"), +] diff --git a/blog/urls.py b/blog/urls.py index 2e00981..9cf1ede 100644 --- a/blog/urls.py +++ b/blog/urls.py @@ -15,10 +15,9 @@ Including another URLconf """ from django.conf.urls.static import static from django.contrib import admin -from django.urls import path +from django.urls import include, path from django.views.generic import TemplateView -from articles.views import api, feeds, html from blog import settings urlpatterns = [ @@ -29,11 +28,7 @@ urlpatterns = [ ), ), path("admin/", admin.site.urls), - path("", html.ArticlesListView.as_view(), name="articles-list"), - path("drafts/", html.DraftsListView.as_view(), name="drafts-list"), - path("feed/", feeds.CompleteFeed(), name="complete-feed"), - path("api/render//", api.render_article, name="api-render-article"), - path("/", html.ArticleDetailView.as_view(), name="article-detail"), + path("", include("articles.urls")), ] if settings.DEBUG: