Move articles urls to their own file

This commit is contained in:
Gabriel Augendre 2020-12-30 14:54:22 +01:00
parent 1b75896e81
commit 345ab6ec1e
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4
2 changed files with 13 additions and 7 deletions

11
articles/urls.py Normal file
View file

@ -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/<int:article_pk>/", api.render_article, name="api-render-article"),
path("<slug:slug>/", html.ArticleDetailView.as_view(), name="article-detail"),
]

View file

@ -15,10 +15,9 @@ Including another URLconf
""" """
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import include, path
from django.views.generic import TemplateView from django.views.generic import TemplateView
from articles.views import api, feeds, html
from blog import settings from blog import settings
urlpatterns = [ urlpatterns = [
@ -29,11 +28,7 @@ urlpatterns = [
), ),
), ),
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("", html.ArticlesListView.as_view(), name="articles-list"), path("", include("articles.urls")),
path("drafts/", html.DraftsListView.as_view(), name="drafts-list"),
path("feed/", feeds.CompleteFeed(), name="complete-feed"),
path("api/render/<int:article_pk>/", api.render_article, name="api-render-article"),
path("<slug:slug>/", html.ArticleDetailView.as_view(), name="article-detail"),
] ]
if settings.DEBUG: if settings.DEBUG: