Django — Can't get static CSS files to load

后端 未结 20 1692
借酒劲吻你
借酒劲吻你 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:28

    You had same path in STATICFILES_DIRS AND STATIC_ROOT, I ran into the same issue and below was the exception -

    ImproperlyConfigured: The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting

    For local you don't need STATICFILES_DIRS, as anyway you don't need to run collectstatic. Once you comment it, it should work fine.

    0 讨论(0)
  • 2020-11-30 00:28

    Add this "django.core.context_processors.static", context processor in your settings.py

    TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.static",
    

    )

    0 讨论(0)
提交回复
热议问题