【问题标题】:Installing eggs theme in django-oscar在 django-oscar 中安装鸡蛋主题
【发布时间】:2015-06-01 09:01:09
【问题描述】:

我在这里找到了 django-oscar 的主题: https://github.com/eggforsale/oscar-eggs-theme 但是没有可用于安装它的文档。 我尝试替换 oscar/templates 目录中的相应文件,但它不起作用。

【问题讨论】:

    标签: python themes django-oscar


    【解决方案1】:

    确保您已将 setting.py 中的 oscar 模板文件夹更新为文档:

        location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', x)
    
    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': [
                location('templates'), # templates directory of the project
            ],
            'APP_DIRS': True,
            'OPTIONS': {
                'context_processors': [
                    'django.template.context_processors.debug',
                    ...
                    'oscar.core.context_processors.metadata',
                ],
            },
        },
    ]
    

    https://django-oscar.readthedocs.io/en/latest/howto/how_to_handle_statics.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-08
      • 2011-05-06
      • 1970-01-01
      • 1970-01-01
      • 2011-02-17
      • 2013-07-11
      • 2012-05-18
      • 2010-11-14
      相关资源
      最近更新 更多