使用 MySql 运行 Django
我有一个供用户使用的现有 MySQL 数据库,并且有一个单独的 django 网站,当前使用 sqlite 来存储所有数据库,例如用户、库存和新闻。
是否可以将两者连接起来?我想要的连接是让项目使用现有的用户表和两个用于库存和新闻的新表。
我在 django 中查找了很多 mysql 的文档,但是那里有指向其他链接的链接,但没有一个链接为我提供了足够的信息来完成此过程。
还有人知道如何查看在 sqlite 中创建的表吗?我需要它们在 MySql 中创建表。
也许这里有人遇到了同样的问题并可以分享经验? 采用 debian 的步骤的建议
如果有帮助的话,我真的很感激关于将运行该项目的系统 。任何意见或意见都表示赞赏:)
I have an existing MySQL database for users, and I have a separate django website that currently uses sqlite for all database storage such as users, inventory and news.
Is it possible to connect both of those? The connection that I want is for the project to use the existing users tables and two new tables for inventory and news.
I was looking a lot through the documentation of mysql in django, but there where links to other links to more links, and none of them provided with enough information for me to do this process.
Also would anyone know how to view the tables that are created in sqlite? I will need them to create tables in MySql.
Maybe someone here had the same issue and could share the experience? I would really appreciate advice on steps to take
the system that will be running this project is debian if that helps. Any comments view or opinions are appreciated :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只是想使用多个数据库,django 1.2 提供了该功能。
https://docs.djangoproject.com/en/dev/topics/ db/多db/
If you are simply looking to use multiple databases, django 1.2 offers the feature.
https://docs.djangoproject.com/en/dev/topics/db/multi-db/