Move articles urls to their own file
This commit is contained in:
parent
1b75896e81
commit
345ab6ec1e
2 changed files with 13 additions and 7 deletions
11
articles/urls.py
Normal file
11
articles/urls.py
Normal 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"),
|
||||||
|
]
|
|
@ -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:
|
||||||
|
|
Reference in a new issue