在开发过程中使用Django,South和Sqlite [英] Using Django, South and Sqlite during development

查看:95
本文介绍了在开发过程中使用Django,South和Sqlite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Python(2.7)和Django(1.5)的新手,正在研究 Django书同时制作一个爱好网站.我使用Sqlite3作为dev db,但在生产中我打算使用MySQL. South看起来是数据库架构迁移管理的绝佳解决方案,但在Sqlite中效果不佳.我现在很想在我的开发机器上安装MySQL,但是想知道是否有避免这种情况的方法.如果有人知道一个简单实用的解决方案,我将不胜感激.

I'm new to Python (2.7) and Django (1.5) and am working through the Django book whilst making a hobby site. I'm using Sqlite3 as dev db, but in production I intend to us MySQL. South looks like a great solution for database schema migration management, but it doesn't play well with Sqlite. I'm now tempted to install MySQL on my dev machine, but wonder if there's a way to avoid that. I'd appreciate knowing a simple, practical solution to this problem, if anyone knows of one.

我的意思是一个程序化的解决方案(对于那些认为这不是主题的人).我以为可以使用Django的settings.py和一些自定义代码来实现此目的.

I meant a programmatic solution (for those that feel this is off topic). I imagined there may be a way to use Django's settings.py and some custom code to accomplish this.

推荐答案

不,这没有办法.要正确使用South,您需要完整的ALTER TABLE支持,其中 SQLite没有.

No, there's no way around this. To use South properly you require complete ALTER TABLE support which SQLite does not have.

这种差异和其他一些小差异将使在MySQL上进行开发成为更好的选择,尤其是如果您打算部署到MySQL.

This and other small differences will make developing on MySQL a better choice, especially if you plan to deploy to MySQL.

这篇关于在开发过程中使用Django,South和Sqlite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆