django标记loaddata错误

发布于 2024-08-09 04:16:56 字数 515 浏览 1 评论 0原文

我正在尝试为一个小型站点从 MySQL 过渡到 SQLite。 django-tagging 用于其中一个模型。对于转换,我使用 dumpdata » loaddata 方法。

dumpdata 命令可以很好地将所有内容从 MySQL 数据库导出到 JSON。当我尝试对 SQLite 数据库运行 loaddata 命令时,出现此错误:

IntegrityError: column name is not unique

我已将此错误隔离到标记应用程序。 loaddata 命令不会告诉我更多信息(“详细”和“回溯”设置没有帮助)。

如何找出输入数据(标签)中的问题以便导入?或者还有另一种方法可以完成这整个事情吗?

I'm trying to do a transition from MySQL to SQLite for a small site. django-tagging is used for one of the models. For the transition I'm using the dumpdata » loaddata method.

The dumpdata command works fine to export everything from the MySQL database into JSON. When I try to run the loaddata command for the SQLite database, I get this error:

IntegrityError: column name is not unique

I have isolated this error to the tagging app. The loaddata command won't tell me more (the "verbose" and "traceback" settings don't help).

How can I find out what's wrong in the input data (the tags) so I can import it? Or is there another way to do this whole thing?

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

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

发布评论

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

评论(1

隔纱相望 2024-08-16 04:16:56

看起来

manage.py reset tagging

在运行 loaddata 命令之前执行此操作可以解决此问题。

It looks like doing

manage.py reset tagging

before running the loaddata command solves this problem.

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