[Django]-Error: Using the URLconf defined in mysite.urls, Django tried these URL patterns

4👍

You are including the blog urls with:

url(r'^blog/', include('blog.urls',
                       namespace='blog',
                       app_name='blog')),

Therefore you should go to http://127.0.0.1:8000/blog/, not http://127.0.0.1:8000/post/ to see your post_list view.

Note that you should use a list and not a set in your blog URLs. Replace the curly braces with square brackets.

urlpatterns = [
    ...
]

0👍

The error means that you don’t have /post/ url defined in your urls.py.

You should either change your urls to this:

urlpatterns = {
    # post views
    url(r'^post/$', views.post_list, name='post_list'),
    ...
}

Or, access the list of posts at /blog/.

I think the first version would be a better choice.

Hope it helps!

Leave a comment