i downloaded a website template from bootstrap and i’ve used it into my django project.then i’ve edited it and the html is loading on running it but the css isn’t loading.i have tried several ways to troubleshoot the problems but it ain’t working.kindly need assistance.
this is my code snippets,
import os
‘’’
STATIC_URL = ‘static/’
STATIC_ROOT = os.path.join(BASE_DIR, ‘static’)
We’ll need to see the directory structure you’re using for these CSS files, what you have in your template for referencing those files, and your STATICFILES_DIRS setting (if you have one).
Note: The previous answer is not necessarily correct.
While STATICFILES_DIRS is frequently used, it is not a requirement. It is only needed if you are supplying static files other than those in apps.
Also, the setting depends upon the directories being used to supply those files. There is no requirement that the directory being referenced is named static, nor that there be only one entry in that list.
That is why we need to understand how you have your static files organized and how you’re trying to reference them.
okay i’m still learning and can you guys show me how you guys copy your file directory tree coz am trying to generate the file tree from my project and it’s too long.how do you co it so that i can post it here on reply
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
bootstrap-icons.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
boxicons.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
bootstrap.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
:8000/static/main/vendor/animate.css/animate.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
:8000/static/main/vendor/aos/aos.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
:8000/static/main/css/style.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
:8000/static/main/vendor/swiper/swiper-bundle.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
why-us.jpg:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
features-2.svg:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
features-1.svg:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
features-3.svg:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
features-4.svg:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
purecounter_vanilla.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
aos.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
bootstrap.bundle.min.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
glightbox.min.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
swiper-bundle.min.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
isotope.pkgd.min.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
noframework.waypoints.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
main.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
validate.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
bootstrap-icons.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
glightbox.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
swiper-bundle.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
aos.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
bootstrap.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
animate.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
style.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
boxicons.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
on my urls and then adjusted my STATIC_ROOT and my STATIC_DIRS ,then rerun the python manage.py collectstatic the runserver and it worked.thanks much anefta