1

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?

Garfonzo
  • 3,876
  • 6
  • 43
  • 78

1 Answers1

2

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.

Ned Batchelder
  • 364,293
  • 75
  • 561
  • 662
  • And you can use `fabric` to automate the deployment. – rczajka Sep 24 '11 at 17:20
  • 1
    I didn't get into all the possible tools, there are many of them. First we need to cover the basics. – Ned Batchelder Sep 24 '11 at 17:22
  • Indeed -- basics before specifics. Thanks for the tips. I really appreciate you laying out the basic steps of development as that helps me better understand what changes I need to make to my process. To date, I have been hacking away at the project on the main production server. The app isn't live yet, I am just trying to figure out the "what if" scenarios before I get there. I suppose I will move the project to a development server and go from there. – Garfonzo Sep 24 '11 at 17:27
  • Are staging servers usually literal clones of the production servers? Furthermore are they usaully completely closed off from the end-user? I was thinking it might be an interesting way to test new code: filter a small group of users to your staging server to test changes. – Timmy O'Mahony Sep 24 '11 at 17:42
  • 1
    Often, they are exact duplicates, or slimmed-down replicas (to save cost). They can be on the public internet just like the production server, but at a different address (staging.mystartup.com), or they may be on a private network. There's plenty of flexibility. – Ned Batchelder Sep 24 '11 at 17:52
  • Thanks for the answers. It's about time I implemented one! – Timmy O'Mahony Sep 24 '11 at 18:01