使用Django临时时出错

2024-04-28 05:43:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用Django模板,但即使我使用了pip install,当我写下以下内容时:

from django.templated_email import send_templated_mail

我得到这个错误(我想使用这个模板:https://github.com/bradwhittington/django-templated-email):

^{pr2}$

如果有人知道如何解决这个问题,请告诉我如何解决(如果有一个很好的例子)

非常感谢


Tags: installpipdjangofromhttpsimportgithubcom
3条回答

从此行中删除django.

from django.templated_email import send_templated_mail

问题是,在说明书中并没有说明您需要添加设置.py,在已安装的应用程序“模板化”电子邮件中

您应该像这样导入from templated_email import send_templated_mail,而不是from django.templated_email import send_templated_mail

相关问题 更多 >