我正在使用Mezzanine,并且想覆盖通用的Django 404和500页面模板。我将错误文件夹复制到:
my_theme/templates/errors
错误中的404.html和500.html模板应覆盖通用模板,但它们不能...我试图将两个文件也直接复制到/templates文件夹中,但无法正常工作。
最佳答案
您正在使用哪个版本的夹层?在旧版本中,模板路径应为my_theme/templates/而不是my_theme/templates/errors/。
另请:https://groups.google.com/forum/#!topic/mezzanine-users/5N94Q33uwvc
此外,您是否在设置中定义了DIRS?像这样:
TEMPLATES = [
{
"DIRS": [
os.path.join(PROJECT_ROOT, "templates")
],
...
另请:https://docs.djangoproject.com/en/1.11/topics/templates/#configuration
关于django - 夹层404和500错误模板未覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40064839/