作者: Adrian Holovaty / Jacob Kaplan-Moss
出版社: Apress
出版年: 2007-12-06
页数: 400
定价: CAD 45.14
装帧: Paperback
ISBN: 9781590597255
内容简介 · · · · · ·
The first part of the book introduces Django fundamentals like installation and configuration. You'll learn about creating the components that power a Django-driven web site. The second part delves into the more sophisticated features of Django, like outputting non-HTML content (such as RSS feeds and PDFs), plus caching and user management. The third part serves as a detailed reference to Django's many configuration options and commands. The book even includes seven appendixes for looking up configurations options and commands. In all, this book provides the ultimate tutorial and reference to the popular Django framework.
http://www.djangoboo
豆瓣成员常用的标签(共37个) · · · · · ·
喜欢读"The Definitive Guide to Django"的人也喜欢 · · · · · ·
按有用程度 按页码先后 最新笔记
-
Chapter 3: Views and URLconfs
irachex (去冬天的空岛)
Chapter 3: Views and URLconfs 自己用ASP.NET MVC 2已经很熟练了,所以有关MVC的内容和设计理念都很了解,主要是对语法点的摘抄 感觉作者的命名有些奇怪,不知道是django有某种约定俗成还是怎么。按我的理解,书中的'views'指MVC中的Controller,书中的'templates'指MVC中的View,为了符合自己的习惯,我把这章称为Controllers and URLconfs。不知道之后的章节会不会推翻我的习惯 [update:看到Chapter 5,django这种叫MTV框.. (更多)Chapter 3: Views and URLconfs自己用ASP.NET MVC 2已经很熟练了,所以有关MVC的内容和设计理念都很了解,主要是对语法点的摘抄感觉作者的命名有些奇怪,不知道是django有某种约定俗成还是怎么。按我的理解,书中的'views'指MVC中的Controller,书中的'templates'指MVC中的View,为了符合自己的习惯,我把这章称为Controllers and URLconfs。不知道之后的章节会不会推翻我的习惯[update:看到Chapter 5,django这种叫MTV框架,Model,Template,View]每个Controller函数至少要有一个参数,通常被叫作request。 这是一个触发这个Controller、包含当前Web请求信息的对象,是类django.http.HttpRequest的一个实例。它必须是这个Controller的第一个参数。from django.http import HttpResponse def hello(request): return HttpResponse("Hello world")settings.py包含一个ROOT_URLCONF配置用来指向自动产生的urls.py,用来配置URL。from django.conf.urls.defaults import * from mysite.views import hello, current_datetime, hours_ahead urlpatterns = patterns('', (r'^$', home), (r'^hello/', hello), (r'^time/plus/(\d{1,2})/, hours_ahead), )(收起)2011-03-10 19:58:23 1人收藏 回应
-
CH2
Ryan (有月正当午,堪与梨花白。)
** The Django Book *** CH2 > django-admin.py startproject mysite __init__.py: A file required for perthon to treat mysite directory as a package. manage.py: A command-line unity that lets you interact with Django project in various ways. settings.py Settings/configuration for Django project. Urls.py: The urls fot the Django project **** Running the Dev Server > python man... (更多)** The Django Book*** CH2> django-admin.py startproject mysite__init__.py: A file required for perthon to treat mysite directory as a package.manage.py: A command-line unity that lets you interact with Django project in various ways.settings.py Settings/configuration for Django project.Urls.py: The urls fot the Django project**** Running the Dev Server> python manage.py runserverThe server was on http://127.0.0.1:8000/Change the Dev Server's Host or port:>python manage.py runserver 0.0.0.0:8000It will alow people visit your site with your IP address*** CH3 Views and URLcontrolTO see the sys.path>>> import sys>>> print sys.path**** ragular expression^ caret: require that the pattern marthes the start of the string$ dollar: require that the pattern matches the end of stringThe root: ('^$', my_homepage_view),Sample:^hello/ will match /hello/foo and /hello/barhello/$ will match /fool/bar/hello/ and foolhello/*allow request without a trailing slash*To set APPEND_SLASH Trueelse APPEND_SLASH False# Regexes.(dot) : any single character\d : any single digit[A-Z] : any character between A and Z[a-z] : any character between a and z[A-Za-z]: case-insenstive+ : one or more of prev expression[^/]+ : one or more charcters untill (and not include) a forward slash? : zero or one of the prev expression(e.g \d? matches zero or one digits*- : zero or more {1,3} : between one and tree or prevexpression (e.g \d{1,3} match one ,two or threee digits)*** Dynamic Content(r'^time/plus/(\{1,2})/$', hours_ahead),r is means a "raw string" -- its contents should not interpret backslashes./in normal Python strings, blackslashes are uesd for escaping special characters -such as in the string \n ./def hours_head(respond,num): ... (收起)2011-10-05 00:35:55 回应
-
第43页
适兕 (我开始鄙视我自己!)
When you create a Template object, the template system compiles the raw template code into an internal, optimized form, ready for rendering. 网站的Template,这是和程序分离的必要组件。 A Python dictionary is a mapping between known keys and variable values. A Context is similar to a diction- ary, but a Context provides additional functionality, Key, Value.多么永恒的组合。 Django... (更多)When you create a Template object, the template system compiles the raw template codeinto an internal, optimized form, ready for rendering. 网站的Template,这是和程序分离的必要组件。A Python dictionary is a mapping between known keys and variable values. A Context is similar to a diction-ary, but a Context provides additional functionality, Key, Value.多么永恒的组合。Django’s template parsing is quite fast. Behind the scenes, most of the parsing hap-pens via a call to a single regular expression. This is in stark contrast to XML-based templateengines, which incur the overhead of an XML parser and tend to be orders of magnitudeslower than Django’s template-rendering engine.我非常喜欢Behind the scenes. (收起)2011-03-17 17:46:03 回应
-
第28页
适兕 (我开始鄙视我自己!)
关于页面URL与view的简单描述: just write view functions and map them to URLs via URLconfs. the principle of loose coupling。 这句话的意思是:松散都耦合原理。 URLconfs and views are loose coupling in action. one of Django’s core philosophies is that URLs should be beautiful. it’s strongly suggested that you use raw strings any time you’re defining a regu- lar expression in Python.... (更多)关于页面URL与view的简单描述:just write view functions and map them to URLs via URLconfs.the principle of loose coupling。这句话的意思是:松散都耦合原理。URLconfs and views are loose coupling in action.one of Django’s core philosophies is that URLs should be beautiful.it’s strongly suggested that you use raw strings any time you’re defining a regu-lar expression in Python. 程序员都是这么较真的吗?In this example, the URLpattern was written first and the view was written second, but in the previous exam-ples, the view was written first and then the URLpattern was written. Which technique is better? Well, everydeveloper is different.If you’re a big-picture type of person, it might make the most sense to you to write all the URLpatternsfor your application at the same time, at the start of your project, and then code up the views. This has theadvantage of giving you a clear to-do list, and it essentially defines the parameter requirements for the viewfunctions you’ll need to write.If you’re more of a bottom-up developer, you might prefer to write the views first and then anchor themto URLs afterward. That’s OK, too.In the end, it comes down to which technique fits your brain the best. Both approaches are valid.不过我还是希望自己是那个有Big-picture的家伙。each view always takes an HttpRequest object as its first parameter.这是入口,没有此一切都是浮云。URLpatterns使用的那个r的意思是 re, 就是我们常用的那个 import re.urls.py中的每条正则表达式都需要用逗号隔开,如果你没有,那你就得去调试一番。 (收起)2011-03-17 15:33:07 回应
-
第43页
适兕 (我开始鄙视我自己!)
When you create a Template object, the template system compiles the raw template code into an internal, optimized form, ready for rendering. 网站的Template,这是和程序分离的必要组件。 A Python dictionary is a mapping between known keys and variable values. A Context is similar to a diction- ary, but a Context provides additional functionality, Key, Value.多么永恒的组合。 Django... (更多)When you create a Template object, the template system compiles the raw template codeinto an internal, optimized form, ready for rendering. 网站的Template,这是和程序分离的必要组件。A Python dictionary is a mapping between known keys and variable values. A Context is similar to a diction-ary, but a Context provides additional functionality, Key, Value.多么永恒的组合。Django’s template parsing is quite fast. Behind the scenes, most of the parsing hap-pens via a call to a single regular expression. This is in stark contrast to XML-based templateengines, which incur the overhead of an XML parser and tend to be orders of magnitudeslower than Django’s template-rendering engine.我非常喜欢Behind the scenes. (收起)2011-03-17 17:46:03 回应
-
CH2
Ryan (有月正当午,堪与梨花白。)
** The Django Book *** CH2 > django-admin.py startproject mysite __init__.py: A file required for perthon to treat mysite directory as a package. manage.py: A command-line unity that lets you interact with Django project in various ways. settings.py Settings/configuration for Django project. Urls.py: The urls fot the Django project **** Running the Dev Server > python man... (更多)** The Django Book*** CH2> django-admin.py startproject mysite__init__.py: A file required for perthon to treat mysite directory as a package.manage.py: A command-line unity that lets you interact with Django project in various ways.settings.py Settings/configuration for Django project.Urls.py: The urls fot the Django project**** Running the Dev Server> python manage.py runserverThe server was on http://127.0.0.1:8000/Change the Dev Server's Host or port:>python manage.py runserver 0.0.0.0:8000It will alow people visit your site with your IP address*** CH3 Views and URLcontrolTO see the sys.path>>> import sys>>> print sys.path**** ragular expression^ caret: require that the pattern marthes the start of the string$ dollar: require that the pattern matches the end of stringThe root: ('^$', my_homepage_view),Sample:^hello/ will match /hello/foo and /hello/barhello/$ will match /fool/bar/hello/ and foolhello/*allow request without a trailing slash*To set APPEND_SLASH Trueelse APPEND_SLASH False# Regexes.(dot) : any single character\d : any single digit[A-Z] : any character between A and Z[a-z] : any character between a and z[A-Za-z]: case-insenstive+ : one or more of prev expression[^/]+ : one or more charcters untill (and not include) a forward slash? : zero or one of the prev expression(e.g \d? matches zero or one digits*- : zero or more {1,3} : between one and tree or prevexpression (e.g \d{1,3} match one ,two or threee digits)*** Dynamic Content(r'^time/plus/(\{1,2})/$', hours_ahead),r is means a "raw string" -- its contents should not interpret backslashes./in normal Python strings, blackslashes are uesd for escaping special characters -such as in the string \n ./def hours_head(respond,num): ... (收起)2011-10-05 00:35:55 回应
-
CH2
Ryan (有月正当午,堪与梨花白。)
** The Django Book *** CH2 > django-admin.py startproject mysite __init__.py: A file required for perthon to treat mysite directory as a package. manage.py: A command-line unity that lets you interact with Django project in various ways. settings.py Settings/configuration for Django project. Urls.py: The urls fot the Django project **** Running the Dev Server > python man... (更多)** The Django Book*** CH2> django-admin.py startproject mysite__init__.py: A file required for perthon to treat mysite directory as a package.manage.py: A command-line unity that lets you interact with Django project in various ways.settings.py Settings/configuration for Django project.Urls.py: The urls fot the Django project**** Running the Dev Server> python manage.py runserverThe server was on http://127.0.0.1:8000/Change the Dev Server's Host or port:>python manage.py runserver 0.0.0.0:8000It will alow people visit your site with your IP address*** CH3 Views and URLcontrolTO see the sys.path>>> import sys>>> print sys.path**** ragular expression^ caret: require that the pattern marthes the start of the string$ dollar: require that the pattern matches the end of stringThe root: ('^$', my_homepage_view),Sample:^hello/ will match /hello/foo and /hello/barhello/$ will match /fool/bar/hello/ and foolhello/*allow request without a trailing slash*To set APPEND_SLASH Trueelse APPEND_SLASH False# Regexes.(dot) : any single character\d : any single digit[A-Z] : any character between A and Z[a-z] : any character between a and z[A-Za-z]: case-insenstive+ : one or more of prev expression[^/]+ : one or more charcters untill (and not include) a forward slash? : zero or one of the prev expression(e.g \d? matches zero or one digits*- : zero or more {1,3} : between one and tree or prevexpression (e.g \d{1,3} match one ,two or threee digits)*** Dynamic Content(r'^time/plus/(\{1,2})/$', hours_ahead),r is means a "raw string" -- its contents should not interpret backslashes./in normal Python strings, blackslashes are uesd for escaping special characters -such as in the string \n ./def hours_head(respond,num): ... (收起)2011-10-05 00:35:55 回应
-
第43页
适兕 (我开始鄙视我自己!)
When you create a Template object, the template system compiles the raw template code into an internal, optimized form, ready for rendering. 网站的Template,这是和程序分离的必要组件。 A Python dictionary is a mapping between known keys and variable values. A Context is similar to a diction- ary, but a Context provides additional functionality, Key, Value.多么永恒的组合。 Django... (更多)When you create a Template object, the template system compiles the raw template codeinto an internal, optimized form, ready for rendering. 网站的Template,这是和程序分离的必要组件。A Python dictionary is a mapping between known keys and variable values. A Context is similar to a diction-ary, but a Context provides additional functionality, Key, Value.多么永恒的组合。Django’s template parsing is quite fast. Behind the scenes, most of the parsing hap-pens via a call to a single regular expression. This is in stark contrast to XML-based templateengines, which incur the overhead of an XML parser and tend to be orders of magnitudeslower than Django’s template-rendering engine.我非常喜欢Behind the scenes. (收起)2011-03-17 17:46:03 回应
-
第28页
适兕 (我开始鄙视我自己!)
关于页面URL与view的简单描述: just write view functions and map them to URLs via URLconfs. the principle of loose coupling。 这句话的意思是:松散都耦合原理。 URLconfs and views are loose coupling in action. one of Django’s core philosophies is that URLs should be beautiful. it’s strongly suggested that you use raw strings any time you’re defining a regu- lar expression in Python.... (更多)关于页面URL与view的简单描述:just write view functions and map them to URLs via URLconfs.the principle of loose coupling。这句话的意思是:松散都耦合原理。URLconfs and views are loose coupling in action.one of Django’s core philosophies is that URLs should be beautiful.it’s strongly suggested that you use raw strings any time you’re defining a regu-lar expression in Python. 程序员都是这么较真的吗?In this example, the URLpattern was written first and the view was written second, but in the previous exam-ples, the view was written first and then the URLpattern was written. Which technique is better? Well, everydeveloper is different.If you’re a big-picture type of person, it might make the most sense to you to write all the URLpatternsfor your application at the same time, at the start of your project, and then code up the views. This has theadvantage of giving you a clear to-do list, and it essentially defines the parameter requirements for the viewfunctions you’ll need to write.If you’re more of a bottom-up developer, you might prefer to write the views first and then anchor themto URLs afterward. That’s OK, too.In the end, it comes down to which technique fits your brain the best. Both approaches are valid.不过我还是希望自己是那个有Big-picture的家伙。each view always takes an HttpRequest object as its first parameter.这是入口,没有此一切都是浮云。URLpatterns使用的那个r的意思是 re, 就是我们常用的那个 import re.urls.py中的每条正则表达式都需要用逗号隔开,如果你没有,那你就得去调试一番。 (收起)2011-03-17 15:33:07 回应
书评 · · · · · · 我来评论这本书
热门评论 最新评论
一个星期搞定Django
-
- 孔明(Gonna make it simple & fast) 确定这个标题权当是“应景”。(Sheldon:sarcasm? Me:Yes!)我的确是花了不到一星期看完了这本书(中文电子版),但是对于很多东西也只是个印象,只能算作是入门,还远远不能说“搞定”,最起码要经受一下实际的考验。 如何精通某物呢?曾经有个“一万个小时天才理论”,看这本书:http://book.doub......2011-08-18 5/5有用来自 Apress2009版
可以去看第二版
-
- res0w(lqik2004) 现在的第二版还有出实体书,但是在作者的网站上已经有一部分了 http://www.djangobook.com/en/2.0/ 而且现在还有中文版也在进行翻译,完成度很不错: http://djangobook.py3k.cn/2.0/ 总之,这是一本除了官方guide之外的一本好书,也几乎是唯......2010-03-14 2/2有用来自 Apress2009版
这里有翻译的中文版,翻译得很好
-
- 我要be happy http://djangobook.py3k.cn/ 书也不错,django好东西 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评...... (2回应)2011-04-24 1/1有用
The Definitive Guide to Django
-
- 涅瓦纳(一个沉默的观影者与读书人) Django, the Python-based equivalent to the Ruby on Rails web development framework, is presently one of the hottest topics in web development today. In The Defi......2011-07-31
是的这本书的确很不错
-
- ouhui818 可以学英语,可以学django.何乐而不为呢?抱歉,你的评论太短了抱歉,你的评论太短了抱歉,你的评论太短了抱歉,你的评论太短了抱歉,你的评论太短了抱歉,你的评论太短了抱歉,你的评论太短了抱歉,你的评论太短了抱歉,你的评论太短了抱歉,你的评论太短了......2011-05-06 来自 Apress2009版
"The Definitive Guide to Django"的论坛 · · · · · ·
- > 点这儿转让 有150人想读,手里有一本闲着?
这本书的其他版本 · · · · · · ( 全部2 )
- Apress版 2009-7-1 / 19人读过
以下豆列推荐 · · · · · · (全部)
- django.framework (元创)
- Web App (某线)
- Django参考书目 (BanditJohnson)
- Python (nolearning)
- Python (Michael)
谁读这本书?
喜欢这本书的人常去的小组 · · · · · ·

- Django (3834)

- Pylons (482)

- Python编程 (19002)

- TurboGears (192)

- MongoDB (2146)

- Gentoo (721)

- ubuntu (5522)

- git (773)
喜欢这本书的人关注的活动 · · · · · ·
订阅关于The Definitive Guide to Django的评论:
feed: rss 2.0











