问题
Right now I am trying to connect my django project html files to static files but keep getting 404 errors. My Project is organized as
src
admin
homePage
media
static
homepage
css
images
fonts
js
templates
in my settings file i have
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'myProjectName/static'),
)
and in my html file
{% static "home/css/bootstrap.css"%}
Why do I keep getting 404 errors ? Thank you for your time.
回答1:
Turn on Debug=True in your settings file and the error page will help you to find out the issue.
来源:https://stackoverflow.com/questions/35393935/django-static-root-404-error