Django Static Root 404 Error

泄露秘密 提交于 2019-12-23 19:48:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!