如何继续开发实时 Django Webapp?

发布于 2024-12-06 05:24:02 字数 407 浏览 0 评论 0原文

我正在构建一个 Django 支持的 Web 应用程序,它有一个大型数据库组件。我想知道,当用户使用实时生产版本时,我将如何继续开发网络应用程序?在我看来,这个问题有两个部分,如下所示:

  1. 更改模板、脚本和其他文件
  2. 更改数据库模式

现在,第一个问题很容易使用 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:

  1. Making changes to templates, scripts, and other files
  2. 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 技术交流群。

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

发布评论

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

评论(1

蹲墙角沉默 2024-12-13 05:24:02

您需要另一台服务器来进行开发。通常,这是一台个人计算机,例如您的笔记本电脑。通常,您还在服务器上拥有生产环境的副本,称为临时服务器。

您的工作流程将如下所示:

  • 在您的开发计算机上处​​理您的代码,进行您想要的所有更改,只有您在使用它。

  • 当代码准备好用于生产时,您将其推送到临时服务器,以查看它是否确实在服务器环境中正常工作。

  • 当您确定它已准备好用于生产时,请将其推送到生产服务器。

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.

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