Going to http://127.0.0.1:8000/admin returns this error:
Using the URLconf defined in the_food_blog.urls, Django tried these URL patterns, in this order:
admin/
[name='home']
<slug:slug>/ [name='post_detail']
^(?P<path>.*)$
The current path, admin, matched the last one.
urls.py
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('blog.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urls.py
urlpatterns = [
path('', views.PostList.as_view(), name='home'),
path('<slug:slug>/', views.PostDetail.as_view(), name='post_detail'),
]
Removing + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) fixes this but why?