Ray's playground

 

随笔分类 -  Django

django Documentation(Getting started)
摘要:While you're editingsettings.py, take note of the INSTALLED_APPSsetting towards the bottom of the file. That variable holds the names of all Django applications that are activated in this Django insta... 阅读全文

posted @ 2010-11-07 18:26 Ray Z 阅读(238) 评论(0) 推荐(0)

Caching(The Definitive Guild to Django)
摘要:Django comes with a robust cache system that lets you save dynamic pages so they don’thave to be calculated for each request. For convenience, Django offers different levels of cachegranularity:... 阅读全文

posted @ 2010-04-07 17:08 Ray Z 阅读(282) 评论(0) 推荐(0)

Sessions, Users, and Registration(The Definitive Guild to Django)
摘要:The session and authorization system is a lot to absorb. Most of the time, you won’t needall the features described in this chapter, but when you need to allow complex interactionsbetween users,... 阅读全文

posted @ 2010-04-03 23:32 Ray Z 阅读(214) 评论(0) 推荐(0)

Generating Non-HTML Content(The Definitive Guild to Django)
摘要:Django has convenient built-in tools that you can use to produce some common non-HTML content:  • RSS/Atom syndication feeds  • Sitemaps (an XML format originally developed by Google that ... 阅读全文

posted @ 2010-04-01 22:32 Ray Z 阅读(182) 评论(0) 推荐(0)

Deploying Django(The Definitive Guild to Django)
摘要:This chapter covers the last essential step of building a Django application: deploying it toa production server.  If you’ve been following along with our ongoing examples, you probably used the... 阅读全文

posted @ 2010-04-01 21:44 Ray Z 阅读(217) 评论(0) 推荐(0)

Generic Views(The Definitive Guild to Django)
摘要:Django ships with generic views to do the following:  • Perform common “simple” tasks: redirect to a different page or render a giventemplate.  • Display list and detail pages ... 阅读全文

posted @ 2010-03-31 22:01 Ray Z 阅读(229) 评论(0) 推荐(0)

Advanced Models(The Definitive Guild to Django)
摘要:In short, a model’s manager is an object through which Django models perform databasequeries. Each Django model has at least one manager, and you can create custom managers tocustomize database ... 阅读全文

posted @ 2010-03-31 09:36 Ray Z 阅读(237) 评论(0) 推荐(0)

Advanced Templates(The Definitive Guild to Django)
摘要:Practice1: Write a custom tagPractice2: Write a custom filter 阅读全文

posted @ 2010-03-30 21:21 Ray Z 阅读(208) 评论(0) 推荐(0)

Advanced Views and URLconfs(The Definitive Guild to Django)
摘要:In Python regular expressions, the syntax for named regular expression groups is(?P<name>pattern), where name is the name of the group and pattern is some pattern to match.  If you put a single ... 阅读全文

posted @ 2010-03-30 10:29 Ray Z 阅读(185) 评论(0) 推荐(0)

Forms(The Definitive Guild to Django)
摘要:Django comes with a form library, called django.forms, that handles many of the issues we’vebeen exploring in this chapter—from HTML form display to validation. Let’s dive in andrewo... 阅读全文

posted @ 2010-03-29 21:38 Ray Z 阅读(302) 评论(0) 推荐(1)

The Django Admin Site(The Definitive Guild to Django)
摘要:admin.pyCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1fromdjango.contribimportadmin2frommysite.books.modelsimportPublisher,Author,Book34classAuthor... 阅读全文

posted @ 2010-03-28 13:45 Ray Z 阅读(243) 评论(0) 推荐(0)

Models(The Definitive Guild to Django)
摘要:What’s the difference between a project and an app?The difference is that of configuration vs. code:  • A project is an instance of a certain set of Django apps, plus the configuration for... 阅读全文

posted @ 2010-03-27 22:44 Ray Z 阅读(234) 评论(0) 推荐(0)

Templates(The Definitive Guild to Django)
摘要:Template:[代码]View:[代码]Settings:settings.pyCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1TEMPLATE_DIRS=(2'/django/mysite/templates',3#Putstringshere... 阅读全文

posted @ 2010-03-26 12:50 Ray Z 阅读(153) 评论(0) 推荐(0)

Views and URLconfs(The Definitive Guild to Django)
摘要:views.pyCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1fromdjango.httpimportHttpResponse,Http4042importdatetime34defhello(request):5returnHttpRespon... 阅读全文

posted @ 2010-03-25 20:31 Ray Z 阅读(250) 评论(0) 推荐(0)

Getting Started(The Definitive Guild to Django)
摘要:Django only supports python 2.4 to python 2.6.  If you run "python setup.py install" with python 3.0+ installed, you will get error like "u'SVN' syntax error".  After running "django-admin.py startpro... 阅读全文

posted @ 2010-03-25 17:48 Ray Z 阅读(261) 评论(0) 推荐(0)

Introduction to Django(The Definitive Guild to Django)
摘要:Django is a web framework.Why I want to learn Django?  Because I want to practice my python skills. 阅读全文

posted @ 2010-03-25 12:57 Ray Z 阅读(287) 评论(0) 推荐(0)

导航