我正在使用Mezzanine,希望覆盖通用的Django 404和500页面模板。我将errors文件夹复制到:
my_theme/templates/errors错误中的404.html和500.html模板应该覆盖通用模板,但它们没有...我也尝试将这两个文件直接复制到/templates文件夹中,但没有成功。
发布于 2017-04-24 18:27:07
您使用的是哪个版本的夹层?在旧版本中,模板路径应该是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
https://stackoverflow.com/questions/40064839
复制相似问题