简体   繁体   English

需要Django 1.2速成课程

[英]Django 1.2 crash course needed

I know Python but I've never used Django. 我知道Python,但我从未使用过Django。

What do I need to know about Django 1.2 to port my typical PHP CRUD web application in one weekend? 关于Django 1.2我需要知道什么才能在一个周末移植我典型的PHP CRUD Web应用程序? (Yes I've read Joel Spolsky's Netscape article :-)) (是的,我读过Joel Spolsky的Netscape文章 :-))

I'm reading this tutorial right now and it's excellent. 我现在正在阅读本教程 ,它非常棒。 I'm already playing around with inspectdb to generate my models from the existing schema. 我已经在使用inspectdb来从现有模式生成我的模型。

I'm planning to use the following this weekend: 我本周末计划使用以下内容:

  • Fragment caching 片段缓存
  • Static asset versioning (for far future expires) 静态资产版本控制(远期将到期)
  • Schema migrations (or whatever they're called in Django) 模式迁移(或者在Django中调用它们)
  • Auto-admin (and customize it later) 自动管理(稍后再自定义)
  • The test framework 测试框架
  • Skins 皮肤
  • ...other stuff I probably don't know about yet ......我可能还不知道的其他东西

I'm familiar with all these concepts in other languages/frameworks, except for the ORM which I've never used. 我熟悉其他语言/框架中的所有这些概念,除了我从未使用过的ORM。 I know SQL pretty well though. 我知道SQL很不错。

Any links, sage bits of advice, gotchas, stuff not mentioned in the (excellent) tutorial/docs, or stuff that is mentioned but warrants repeating == very welcome. 任何链接,咨询,陷阱,在(优秀)教程/文档,或东西没有提到的东西圣人位提及,但权证重复==非常欢迎。 Thanks! 谢谢!

The django docs is very good and you should find the answers to most of your questions http://docs.djangoproject.com/en/1.2/ django文档非常好,您应该找到大多数问题的答案http://docs.djangoproject.com/en/1.2/

You can google it easily but make sure that you are on the doc pages of django 1.2. 你可以轻松谷歌,但要确保你在django 1.2的doc页面上。

For schema migration, I recommed to look at south http://south.aeracode.org/ 对于模式迁移,我建议查看南http://south.aeracode.org/

In my opinion south is a must-have feature for a website. 在我看来,南方是网站的必备功能。 It is quite easy and fast to get started. 入门非常简单快捷。 The tutorial on their website should help you. 他们网站上的教程应该可以帮到你。 I think that it will be a big help if you plan to make some schema migration in the week-end. 我认为如果你计划在周末进行一些模式迁移,这将是一个很大的帮助。 If not you can wait a little. 如果没有,你可以稍等一下。 I've never used south on a db generated by inspectdb but I guess that it should work ok :) 我从来没有在inspectdb生成的数据库上使用南,但我猜它应该工作正常:)

Have a nice week-end :) 周末愉快 :)

My best piece of advice: learn Python. 我最好的建议是:学习Python。

Django is wonderful, but at it's root it's just Python. Django很精彩,但它根本就是Python。 You'll be able to get a long way just following the documentation and tutorials you find around the web, but you won't really benefit as much as possible if you try and use your PHP idioms instead of Pythonic ones. 只需按照您在网络上找到的文档和教程,您就可以获得很长的路要走,但如果您尝试使用PHP习语而不是Pythonic,那么您将无法获得尽可能多的好处。

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

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