【问题标题】:Changing the default folder in django-static更改 django-static 中的默认文件夹
【发布时间】:2012-11-14 16:13:27
【问题描述】:

我正在考虑使用 django-static 来提供静态内容 (https://github.com/peterbe/django-static)

但是 django-static 总是假定所有的“静态内容”总是放在“媒体”文件夹中。我可以将其配置为不同的文件夹吗?

我检查了配置选项,但找不到任何东西。

【问题讨论】:

    标签: django django-static


    【解决方案1】:

    我认为它使用MEDIA_ROOT 设置来查找源文件。

    来自其文档

    默认情况下 django_static 将在 MEDIA_ROOT 中查找源文件,但可以告诉 django_static 查找 DJANGO_STATIC_MEDIA_ROOTS 中列出的所有目录。将使用第一个匹配项。

    【讨论】:

      【解决方案2】:

      静态文件处理是built into django。建议您改用它。

      【讨论】:

        猜你喜欢
        • 2010-09-08
        • 1970-01-01
        • 2016-05-30
        • 1970-01-01
        • 2023-03-23
        • 1970-01-01
        • 2016-03-28
        • 2012-05-13
        • 2013-01-07
        相关资源
        最近更新 更多