1.view兩個做用: 返回httpresponse對象或發起一個exception,通常view會加載一個模板並用渲染模板
code
2.Django的settings中指定directories,按順序check directory
對象
3.three
# Create three choices.>>> p.choice_set.create(choice='Not much', votes=0)<Choice: Not much >>> p.choice_set.create(choice='The sky', votes=0)<Choice: The sky >>>> c = p.choice_set.create(choice='Just hacking again', votes=0) # Choice objects have API access to their related Poll objects. >>> c.poll<Poll: What's up?># And vice versa: Poll objects get access to Choice objects. >>> p.choice_set.all()[<Choice: Not much>, <Choice: The sky>, <Choice: Just hacking again>] >>> p.choice_set.count()