如何继续开发实时 Django Webapp?
我正在构建一个 Django 支持的 Web 应用程序,它有一个大型数据库组件。我想知道,当用户使用实时生产版本时,我将如何继续开发网络应用程序?在我看来,这个问题有两个部分,如下所示:
- 更改模板、脚本和其他文件
- 更改数据库模式
现在,第一个问题很容易使用 SVN 系统进行管理。哎呀,我可以有一个“dev”目录,其中包含我所有正在开发的文件,一旦准备好,只需将它们复制到“生产”目录中即可。
然而,第二个问题让我更困惑。如何在不影响主/实时数据库的情况下测试/开发新的数据库更改?我一直在使用 South
在 Web 应用程序的初始创建阶段进行架构迁移,但我肯定不想在使用数据库时对数据库进行更改 >。特别是如果我做出了不想保留的更改。
有什么想法/想法吗?
I am building a Django powered web app that has a large database component. I am wondering, how would I go about continuing to develop the web app while users are using the live, production version? There are two parts to the problem, as I see it, as follows:
- Making changes to templates, scripts, and other files
- Making database schema changes
Now, the first problem is easy to manage with a SVN system. Heck, I could just have a "dev" directory which have all my in-development files and, once ready, just copy them into the "production" directory.
However, the second problem is more confusing to me. How do I test/develop new database changes without affecting the main/live database? I have been using South
to do schema migrations during the initial creation stages of the web app, but surely I wouldn't want to make changes to the database while it is being used. Especially if I make changes that I don't want to keep.
Any thoughts/ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要另一台服务器来进行开发。通常,这是一台个人计算机,例如您的笔记本电脑。通常,您还在服务器上拥有生产环境的副本,称为临时服务器。
您的工作流程将如下所示:
在您的开发计算机上处理您的代码,进行您想要的所有更改,只有您在使用它。
当代码准备好用于生产时,您将其推送到临时服务器,以查看它是否确实在服务器环境中正常工作。
当您确定它已准备好用于生产时,请将其推送到生产服务器。
You need another server on which to do your development. Typically, this is a personal machine, like your laptop. Often, you also have a copy of your production environment on a server, known as the staging server.
Your workflow would be like this:
Work on your code on your development machine, make all the changes you want, it's just you using it.
When the code is ready for production, you push it to the staging server to see that it really works properly in a server environment.
When you're sure it's ready for production, push it to the production server.