开发者

Django version selection

开发者 https://www.devze.com 2022-12-20 03:45 出处:网络
Greetings, I am currently working on开发者_开发问答 a long term project that uses Django 1.1.1, and we are planning to release it around march of 2010.

Greetings, I am currently working on开发者_开发问答 a long term project that uses Django 1.1.1, and we are planning to release it around march of 2010.

Now while surfing I came upon to this article which says the planned release date of Django 1.2.0 is March 9, 2010.

Now I am a bit confused. If I should continue developing under 1.1.1 or start developing using 1.2.0 beta.


I'd say only develop for the latest version if there is a specific feature you need/like. Read up on it so you know of course what is in store.

1.0 onwards. I've found swapping django versions to be relatively trouble free. At any stage all you need to do is swap symlinks on a source tree on your test server. and of course running that thorough unit test suite you've written will show up any version skew bugs.


The upgrade path is not difficult. I would familiarize yourself with the differences and avoid deprecations, but continue on the battle tested 1.1 branch. While you should never ever trust software release dates, you also probably don't want to bet your farm on a brand new branch with features you clearly don't need yet. You've got plenty to do to release in a month. Upgrade when you have time. If your release was scheduled for June you might consider it, but for now stick with stability. That's mho.


Part of our current application under development is being put into production now, but we hope to use Django 1.2 final. Our strategy is to write code, test and deploy using Django 1.1.1, but also test using virtualenv. There's really no reason not to test your code under 1.2 whatever your deployment decision because you'll want it eventually to be compatible with 1.2.

virtualenv makes the whole process painless and is the key to quickly switching between environments. It's incredibly easy to set up:

easy_install virtualenv
virtualenv django12
cd django12
source bin/activate

Then download and install Django 1.2 in the virtual environment and run your tests. I run the development server in virtualenv on port 8081, so I can have both servers -- using the same application code -- running at the same time, ports 8080, 8081.

In our case we had to remove one import and wrap a few others with try/except conditions. I had to write a dummy csrf_token template tag for CSRF to work -- the Django developers have informed me they'll include a dummy tag in 1.2 final. We also upgraded the South migrations tool to 0.7-pre, as the current release doesn't support Django 1.2.

Bottom line: Regardless of your deployment decision, a case can be made for testing both versions of Django if at all possible.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号