The Course App

Cleaning up our article URLs

Want more?

This lesson for enrolled students only. Join the course to unlock it!

You can see the code changes implemented in this lecture below.

If you have purchased the course in a different platform, you still have access to the code changes per lecture here on Teclado. The lecture video and lecture notes remain locked.
Join course for $15

Modified files

app/urls.py
--- 
+++ 
@@ -8,7 +8,7 @@

 urlpatterns = [
     path("", ArticleListView.as_view(), name="home"),
-    path("articles/create/", ArticleCreateView.as_view(), name="create_article"),
-    path("articles/<int:pk>/update/", ArticleUpdateView.as_view(), name="update_article"),
-    path("articles/<int:pk>/delete/", ArticleDeleteView.as_view(), name="delete_article"),
+    path("create/", ArticleCreateView.as_view(), name="create_article"),
+    path("<int:pk>/update/", ArticleUpdateView.as_view(), name="update_article"),
+    path("<int:pk>/delete/", ArticleDeleteView.as_view(), name="delete_article"),
 ]
djangocourse/urls.py
--- 
+++ 
@@ -19,5 +19,5 @@

 urlpatterns = [
     path("admin/", admin.site.urls),
-    path("", include("app.urls"))
+    path("articles/", include("app.urls"))
 ]