Django 已弃用的标签/初学者

发布于 2024-08-12 21:55:50 字数 457 浏览 4 评论 0原文

高级开发人员(也是我们公司唯一有 Django 经验的人)已经搬走了并离开了我们。此后不久(按照他的指示),我们将一个站点推送到共享服务器上(我们对服务器具有完全控制权),并将 Django 版本更新到最新版本,以便新站点可以正常工作。

从那时起,我们就遇到了使用旧版本构建的其他 Django 项目的问题。

我遇到的主要问题是我们有一个 crontab,它会向客户发送一封电子邮件,概述他们的订单。我已经截取了我遇到的错误的屏幕截图,但说实话,我很难理解它。为了保护无辜者(客户),这些名字已被更改。

http://i-am-a-fish.co.uk/help。 png

我再次上传了屏幕截图 i-am-a-fish.co.uk/help2.png

非常欢迎所有建议!

The senior developer (and the only person experienced with Django in our company) has moved away and left us. Shortly after this (following his instructions) we pushed a site live onto a shared server (we have full control over the server) and updated the version of Django to the latest release for the new site to work.

Since then we have had issues with the other Django project on there which was built using an older version.

The main issue that I have is that we have a crontab that sends an email to the client outlining their orders. I have taken a screen grab of the error that I am getting but if I am honest I am struggling to make any sense of it. The names have been changed to protect the innocent (client).

http://i-am-a-fish.co.uk/help.png

I have uploaded a screen grab again i-am-a-fish.co.uk/help2.png

All suggestions are very welcomed!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遮了一弯 2024-08-19 21:55:50

弃用警告不是原因,您可以忽略它(除非您想修复并使用 hashlib)。原因是您的自定义 EmailAlternativesMessage 类未定义 multipart_subtype。尝试找到 EmailAlternativesMessage 的声明并添加

class EmailAlternativesMessage(EmailMessage):
  multipart_subtype = 'alternative'
  ...

Deprecation warning is not the reason, you can ignore it (unless you want to fix and use hashlib). The reason is multipart_subtype which your custom EmailAlternativesMessage class is not defining. Try to find declaration of EmailAlternativesMessage and add

class EmailAlternativesMessage(EmailMessage):
  multipart_subtype = 'alternative'
  ...
命硬 2024-08-19 21:55:50

现在您眼前的问题已经解决,真正的解决方案是使用 virtualenv 来隔离每个项目的与其他站点的依赖关系(包括 Django 本身),因此部署基于最新 Django 的项目不需要立即升级服务器上的所有其他站点。

Now that your immediate problem is fixed, the real solution here is to use virtualenv to isolate each project's dependencies (including Django itself) from the others, so deploying a project based on recent Django doesn't require an immediate upgrade of every other site on the server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文