【Python之Django 介绍】

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.

Django是一个开放源代码的Web应用框架,由Python写成。采用了MVC的软件设计模式,即模型M,视图V和控制器C。



 

Why Django?

With Django, you can take Web applications from concept to launch in a matter of hours. Django takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.

Ridiculously fast. 快得离谱

Django was designed to help developers take applications from concept to completion as quickly as possible.

Reassuringly secure.令人放心的安全

Django takes security seriously and helps developers avoid many common security mistakes.

Exceedingly scalable.非常可伸缩/扩展

Some of the busiest sites on the Web leverage Django’s ability to quickly and flexibly scale.

Fully loaded.满载多功能

Django includes dozens of extras you can use to handle common Web development tasks. Django takes care of user authentication, content administration, site maps, RSS feeds, and many more tasks — right out of the box.

Incredibly versatile.难以置信的多功能

Companies, organizations and governments have used Django to build all sorts of things — from content management systems to social networks to scientific computing platforms.

Django 框架的核心组件有:

1)用于创建模型的对象关系映射

2)为最终用户设计的完美管理界面

3)一流的 URL 设计

4)设计者友好的模板语言

5)缓存系统

Django基于MVC的设计十分优美:

1)对象关系映射 (ORM,object-relational mapping):以Python类形式定义你的数据模型,ORM将模型与关系数据库连接起来,你将得到一个非常容易使用的数据库API,同时你也可以在Django中使用原始的SQL语句。

2)URL 分派:使用正则表达式匹配URL,你可以设计任意的URL,没有框架的特定限定。像你喜欢的一样灵活

3)模版系统:使用Django强大而可扩展的模板语言,可以分隔设计、内容和Python代码。并且具有可继承性。

4)表单处理:你可以方便的生成各种表单模型,实现表单的有效性检验。可以方便的从你定义的模型实例生成相应的表单。

5)Cache系统:可以挂在内存缓冲或其它的框架实现超级缓冲 -- 实现你所需要的粒度。

6)会话(session),用户登录与权限检查,快速开发用户会话功能。

7)国际化:内置国际化系统,方便开发出多种语言的网站。

8)自动化的管理界面:不需要你花大量的工作来创建人员管理和更新内容。Django自带一个ADMIN site,类似于内容管理系统

猜你喜欢

转载自gaojingsong.iteye.com/blog/2378404