Skip to content Skip to sidebar Skip to footer

Reverse For 'post_edit' With Arguments '()' And Keyword Arguments '{'pk': 6}' Not Found. 0 Pattern(s) Tried: []

I've been following djangogirls' tutorial to create a blog with django with little to no trouble, but now I'm going on with their extensions tutorial which works on the web applica

Solution 1:

The blog app is under the namespace blog. Every reference to a URL to this app should be of the form namespace:url_name.

So, you should use a namespace inside the {% url %} template tag. You are doing it correctly inside the offending template and you should do the same inside the base template too.

So inside base.html (and anywhere else blog urls are involved):

<!-- base.html -->

{% url 'blog:post_new' %}
{% url 'blog:post_draft_list' %}

Leave {% url 'login' %} and {% url 'logout' %} as is. They are not namespaced.

Post a Comment for "Reverse For 'post_edit' With Arguments '()' And Keyword Arguments '{'pk': 6}' Not Found. 0 Pattern(s) Tried: []"