Django — Can't get static CSS files to load

后端 未结 20 1830
借酒劲吻你
借酒劲吻你 2020-11-29 23:45

I\'m running Django\'s development server (runserver) on my local machine (Mac OS X) and cannot get the CSS files to load.

Here are the relevant entries

20条回答
  •  迷失自我
    2020-11-30 00:07

    For recent releases of Django, You have to configure static files in settings.py as,

    STATIC_URL = '/static/' # the path in url
    
    STATICFILES_DIRS = [
        os.path.join(BASE_DIR, "static"),
    ]
    

    and use it with static template tag,

    {% load static %}
    
    

提交回复
热议问题