Django is v5.1
Have this settings.py:
STATIC_URL = 'static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_URL = 'media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
This urls.py:
urlpatterns = [
path('graphql', include('api.urls')),
path('mdeditor/', include('mdeditor.urls')),
path('admin/', admin.site.urls),
path('', RedirectView.as_view(url=reverse_lazy('admin:index'))),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL,
document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)
This overridden admin/base.html:
{% extends 'admin/base.html' %}
{% load static %}
{% block extrahead %}
<link rel="shortcut icon" href="{% static 'favicon.ico' %}" />
{% endblock %}
This structure:
And it’s not serve static files from static folder. Just shows 404. But serving static files from media folder.
I have absolutely no idea where the error can be found here.