Chinaunix首页 | 论坛 | 博客
  • 博客访问: 319927
  • 博文数量: 60
  • 博客积分: 2781
  • 博客等级: 少校
  • 技术积分: 600
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-23 16:42
文章分类

全部博文(60)

文章存档

2011年(33)

2010年(27)

分类: Python/Ruby

2011-05-15 21:44:06

Tutorial 1:
Set up environment
Modify proj/settings.py proj/urls.py
Show django admin site
Python manage.py startapp app_name
Modify proj/app_name/models.py

Tutorial 2:
Show app_name in admin site(create admin.py in proj/app_name/)
Custom the admin form(proj/app_name/admin.py)
Customize the admin change list(list_display, list_filter, search_fields, date_hierarchy)
Customize the admin look and feel(Use django template system, create proj/templates/admin/)
Introduce template language {% tags %} {{ variables }} {{ foo | bar }} {% block %}

Tutorial 3:
Design URLs(regular expression, Python callback function [, optional dictionary])
Write views(callback functions when you type url), you can treat views.py as controllers in MVC
from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404
404 error page and 500 error page: from django.conf.urls.defaults import *, use default error page is recommended, but you also can create your own error page in template root dir
Simplify and decouple the URLconfs

Tutorial 4:
Code-shuffle: Why? It intentionally ensure you must understand the basic django knowledge, then turn your face to advanced solutions.
Use generic views for less code:Convert URLconf; Delete some codes of views; Fix up URL handling for new views
阅读(1881) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

applesun2011-06-16 16:39:28

renwofei423: 这是准备写书吗??.....
哦,不好意思写的挺凌乱的,这个就是我读完之后做的个概要笔记,说的每章讲了什么东东

renwofei4232011-06-16 13:54:48

这是准备写书吗??