Skip to content

error in code "realpython" #3

@knowledgecomputer2018

Description

@knowledgecomputer2018

hi how are you .

tutorial link:
https://realpython.com/get-started-with-django-1/

your code:

blog/urls.py

from django.urls import path
from . import views

urlpatterns = [
path("", views.blog_index, name="blog_index"),

path("<int:pk>/", views.blog_detail, name="blog_detail"),
path("<category>/", views.blog_category, name="blog_category"),

]

my question is :why if my change code to :

blog/urls.py

from django.urls import path
from . import views

urlpatterns = [
path("", views.blog_index, name="blog_index"),

path("<category>/", views.blog_category, name="blog_category"),
path("<int:pk>/", views.blog_detail, name="blog_detail"),

]

do not work? only function "blog_category" is work (priority is important in urls.py or no).

good luck
god willing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions