简体   繁体   中英

Migrating a Google App Engine application from Django 0.96 to Django 1.2

I will soon start to port my different Google App Engine applications built with the default version of Django (0.96) to Django 1.2. I generally don't use any specific Django modules apart from the i18n stuff to get the websites translated.

I plan to go through the backwards-incompatible changes to Django from 0.96 to 1.0 and the different Django release notes . Those are the current release notes available between 0.96 and 1.2:

  • 1.2 release
    • Django 1.2.5 release notes
    • Django 1.2.4 release notes
    • Django 1.2.2 release notes
    • Django 1.2 release notes
  • 1.1 release
    • Django 1.1.4 release notes
    • Django 1.1.3 release notes
    • Django 1.1.2 release notes
    • Django 1.1 release notes
  • 1.0 release
    • Django 1.0.2 release notes
    • Django 1.0.1 release notes
    • Django 1.0 release notes

I am wondering if there is a better way of doing this migration/upgrade, or if someone that has already done it would have some useful tips. I know there's a lot of reading involved, and that's not what I'm trying to prevent, but more to get pointers to smoothen this process.

I have different applications to migrate, but will start with a simple/small application to get the gist of it.

Rather than trying to figure out everything that's changed between Django 0.96 and 1.2, my advice would be to write a test suite to cover your UI behavior. You can unit test each of your templates with the new testbed framework , or write full browser-based integration tests with something like Selenium .

Once you have working tests, just update Django, re-run your tests and see what breaks. If you have integration tests, you can also test your changes against production by uploading a non-default version .

I recently managed to upgrade my rather large application with experience that it was very easy once knowing what to do. In addition to getting django 1.2 loaded which is described above I had to make 3 changes: 1) change the i18n import to some other so-called lazy import for the function we call _ i18n has. 2) I had to change some RSS handling that you probably don't have. 3) The humanize library is no longer used. Once knowing how to do it making the actual upgrade only took me about 5 or 10 minutes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM