我正面临django oscar模板覆盖的问题。我正在使用Oscar 2.0.3和Django 2.2.7
我正在使用文档中提到的method-1。我的项目结构看起来像
myproject
cache
catalogue (I have overridden this app)
categories
images
templates
base.html
myproject
manage.py
我将TEMPLATES
编辑为
import os
location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', x)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [location('templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'oscar.apps.search.context_processors.search_form',
'oscar.apps.checkout.context_processors.checkout',
'oscar.apps.customer.notifications.context_processors.notifications',
'oscar.core.context_processors.metadata',
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
并且我正在base.html
中进行更改,但它们不会在127.0.0.1:8000/catalogue/
中复制(127.0.0.1:8000
重定向到此URL)
非常感谢您的帮助!谢谢!
您重定向的内容如何?这可能是由于重定向文件夹的引用不正确引起的。我也犯了这样的错误。