[Fixed]-Django static file loading adds a non-existent directory to the file path

1👍

Try to use the solution to serve static files during development:

from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    ....
] 

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

PROBLEM SOLVED:

Your STATIC_URL should be STATIC_URL = '/static/' in your settings.py

Leave a comment