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!
- [Django]-DRF: Always apply default permission class
- [Django]-Django : ModelForm with OneToOneField
- [Django]-Django: How to dynamic filter foreignkey choices by Customizing the Django_Admin
- [Django]-Why DateTimeField with auto_now_add can not get in form fields
Source:stackexchange.com