简体   繁体   English

将 Google App Engine 应用程序从 Django 0.96 迁移到 Django 1.2

[英]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.我将很快开始将使用默认版本 Django (0.96) 构建的不同 Google App Engine 应用程序移植到 Django 1.2。 I generally don't use any specific Django modules apart from the i18n stuff to get the websites translated.除了 i18n 的东西之外,我通常不使用任何特定的 Django 模块来翻译网站。

I plan to go through the backwards-incompatible changes to Django from 0.96 to 1.0 and the different Django release notes .我计划通过对 Django 从 0.96 到 1.0 的向后不兼容更改以及不同的 Django发行说明来实现 go。 Those are the current release notes available between 0.96 and 1.2:这些是 0.96 和 1.2 之间可用的当前发行说明:

  • 1.2 release 1.2 发布
    • Django 1.2.5 release notes Django 1.2.5 发行说明
    • Django 1.2.4 release notes Django 1.2.4 发行说明
    • Django 1.2.2 release notes Django 1.2.2 发行说明
    • Django 1.2 release notes Django 1.2 发行说明
  • 1.1 release 1.1 发布
    • Django 1.1.4 release notes Django 1.1.4 发行说明
    • Django 1.1.3 release notes Django 1.1.3 发行说明
    • Django 1.1.2 release notes Django 1.1.2 发行说明
    • Django 1.1 release notes Django 1.1 发行说明
  • 1.0 release 1.0 版本
    • Django 1.0.2 release notes Django 1.0.2 发行说明
    • Django 1.0.1 release notes Django 1.0.1 发行说明
    • Django 1.0 release notes Django 1.0 发行说明

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.与其试图找出 Django 0.96 和 1.2 之间发生的所有变化,我的建议是编写一个测试套件来涵盖您的 UI 行为。 You can unit test each of your templates with the new testbed framework , or write full browser-based integration tests with something like Selenium .您可以使用新的 测试平台框架对每个模板进行单元测试,或者使用Selenium 之类的东西编写完整的基于浏览器的集成测试。

Once you have working tests, just update Django, re-run your tests and see what breaks.一旦你有工作测试,只需更新 Django,重新运行你的测试,看看有什么问题。 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.除了如上所述加载 django 1.2 之外,我还必须进行 3 处更改:1)将 i18n 导入更改为其他一些所谓的惰性导入,用于我们称为_的 function。 2) I had to change some RSS handling that you probably don't have. 2) 我不得不更改一些您可能没有的 RSS 处理。 3) The humanize library is no longer used. 3) 不再使用人性化库。 Once knowing how to do it making the actual upgrade only took me about 5 or 10 minutes.一旦知道如何进行实际升级,我只花了大约 5 或 10 分钟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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