Django 快速实战入门(一):概述

Django (读作:[‘dʒæŋgoː]),它是目前最流行的基于 Python 开发的 Web 开发框架之一。

因为 Python 本身不像 PHP 一样是专门为开发 Web 应用而设计的,因此如果不使用框架,开发效率会非常低。而在使用框架后,整个系统的结构和代码的组织会更加清晰明了,并具备一定的可扩展性,同时也利于模块或代码的重用。这样,在开发 Web 应用时不但可以节约大量的开发时间,还可以享受简洁高效的开发带来的乐趣。

除了 Django,类似框架的还有 TurboGearsweb.py 等等,本文介绍笔者初次接触的 Python Web 开发框架 Django,并通过建立一个简易的留言板为例来帮助大家快速了解 Django。

本文假设您使用 Linux 作为开发环境,并且已经掌握 Linux 的基本操作以及 Python 的基础知识。示例代码中所使用到的 Django 版本为 1.0.1。

Django 架构

Django 作为一个 Web 开发框架,它包括以下基本组成部分:

  1. HTTP 请求处理与响应
  2. URL 映射
  3. 视图控制
  4. 模板系统
  5. 数据库操作模型

其中模型是通过 Django 内建的 ORM 机制实现的,而模板系统也依赖于内建的模板引擎。

Django 的基本架构如下:

Django 架构

在此基本模型基础上,Django 还实现了许多常用且实用的中间件,如负载均衡、缓存和 Session 等。

作者信息

Hily Jiang,具有两年的嵌入式 Linux 开发经验和一年的 PHP Web 统计系统开发经验。在技术领域兴趣广泛,喜欢制作一些小玩意儿。Python 和 C++ 将作为他以后的主要开发语言。琴棋书画皆略有接触,然样样皆不精通。向往自由、无拘无束的生活。

如有疑问或建议,请通过以下方式联系作者:

个人网络平台:http://hily.me/

Email:hilyjiang [At] Gmail

参考资源

下一节 >>>

Django 快速实战入门(二):组建开发环境

组建一个 Django 的开发环境,建立我们的项目,并启动一个开发服务器。

— EOF —

《Django 快速实战入门(一):概述》有18个想法

  1. Only wanna remark on few general things, The website style is perfect, the articles is real good. “Some for renown, on scraps of learning dote, And think they grow immortal as they quote.” by Edward Young.

  2. certainly like your web site but you need to test the spelling on quite a few of your posts. Several of them are rife with spelling issues and I to find it very troublesome to inform the truth on the other hand I¡¦ll surely come again again.

  3. Simply wish to say your article is as amazing. The clearness in your post is just great and i can assume you are an expert on this subject. Well with your permission let me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please continue the rewarding work.

  4. I do not even know how I ended up right here, but I thought this publish was once good. I don’t know who you’re but certainly you’re going to a well-known blogger for those who are not already. Cheers!|

  5. After research just a few of the weblog posts on your website now, and I really like your way of blogging. I bookmarked it to my bookmark website listing and will likely be checking again soon. Pls check out my website as well and let me know what you think.

  6. Hey I meant to answer you ages ago. I was kind of wiped out the past few days. But yes kind of! Though it’s mainly this fabric. I’ve never found it again and when I found it I bought as much as I could. It’s so spongy and different than most cotton. So, I will at some point make them in new fabrics again. I could never totally let go of the Louche. I don’t know how many are out there. I could count th0h8u&#g23o; I’ll count at some point :)

  7. bekommst du hier was du brauchst, denn ein günstiger Telefonfick kostet hier je nach Sexnummer nur 4 Cent, 14 Cent oder 49 Cent.

发表评论

电子邮件地址不会被公开。 必填项已用*标注