Answer the question
In order to leave comments, you need to log in
Django not applying css file 404 error??
I did everything as in the Django documentation, but nothing works
settings
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(PROJECT_ROOT, "static")
STATICFILES_DIRS = os.path.join(BASE_DIR, 'static')
URL
urlpatterns = [
path('grappelli/', include('grappelli.urls')),
path('admin/', admin.site.urls),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Html
{% load static %}
well and further
where to dig???
Answer the question
In order to leave comments, you need to log in
If you are on a local computer under Windows, then it is easier to copy the path to the folder
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join('C:\PythonProject\name.project\app\static'),
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question