Django是一个以“内置电池”为设计哲学的被广泛使用的Python web应用框架。“内置电池”的原则即是构建web应用的常见功能应该包含在框架之内,而不是依赖单独的外部库。
举个例子, 用户认证、 URL路由、 模版系统、 对象关系映射ORM和 数据库迁移 (1.7版本引进)都包含在Django框架中。试着比较一下自带用户认证功能的Django框架和依赖外部库如 Flask-Login 实现的Flask框架。
在框架本身的构建中,“内置电池”和“可扩展”这两种哲学显然大相径庭,不过这两种内在哲学并没有哪个好哪个不好。
Django项目的稳定、性能、社区自其诞生的十年来取得了极大的成长。不管是书中还是在网上很容易就能获取到详尽的教程和最佳实践(best practices),并且随着新版本的释出,很多有意义的新功能如数据库迁移还在继续加入到框架中去。
我强烈推荐Python web开发新手们以Django作为起点,因为在软件开发的过程中官方提供的文档和教程都是一些精品资源。另外许多城市都有专门的Django团体,诸如Django District, Django Boston 和 San Francisco Django, 许多新手开发者在遇到问题时可以在那里得到帮助。[译者注:中文社区]
另外有一个争论点是:有人认为通过Django来学习Python是个坏主意。不过,在你投入到web开发之前你已经花时间学习了Python的语法、语义的话,这些批评的声音就大可不以为意了。
Tango with Django are a extensive free introductions to using the most popular Python web framework. Several current developers said this book really helped them get over the initial framework learning curve.
2 Scoops of Django by Daniel Greenfield and Audrey Roy is well worth the price of admission if you're serious about learning how to correctly develop Django websites.
Effective Django is another free introduction to the web framework.
The Django subreddit often has links to the latest resources for learning Django.
Lincoln Loop wrote a Django Best Practices guide for the community.
Steve Losh wrote an incredibly detailed Django Advice guide.
Lightweight Django has several nice examples for breaking Django into smaller simplier components.
Making a specific Django app faster is a Django performance blog post with some tips on measuring performance and optimizing based on the measured results.
Django Debug Toolbar is a powerful Django ORM database query inspection tool. Highly recommended during development to ensure you're writing reasonable query code. Django Silk is another inspection tool and has capabilities to do more than just SQL inspection.
GoDjango 提供怎样构建Django应用的免费短视频教程。
Ontwik在 Django分类 有视频教程。
Designing Django's Migrations covers Django 1.7's new migrations from the main programmer Andrew Godwin.
DjangoCon US videos from
2013,
2012,
2011, as well as
earlier US and DjangoCon EU conferences are
all available free of charge.
Txt 2 React is a full Django web app that allows audiences to text in during a presentation with feedback or questions.
Openduty is a website status checking and alert system similar to PagerDuty.
在你的本地开发环境中安装Django
将Django的第一个 "投票"教程 从头到尾做一遍。
借助教程和上面的Django资源做一个稍稍复杂的应用。
在 官方文档 和上面提到的资源链接的帮助下开始自己的Django项目之旅。你可能会遇到不少挫折,不过这些对你通往正确的应用开发之路来说是至关重要的。
阅读 2 Scoops of Django 这本书理解Django的最佳实践并学会用更好的方式来构建Django web应用。
移步 部署小节 把你的Django应用发布到网上。