Cheese Is Power

Knowledge is power, to make others feel stupid.

Notes for Studying Django

  1. Once you added a new application to INSTALLED_APPS, the database tables need to be updated, thus you need to run python manage.py syncdb.
  2. Normally the server auto-reloads code every time you modify a file, but creating a new file does not trigger the auto-reloading logic. If a new file is added you need to restart the development server by using python manage runserver.
  3. The url() function is passed four arguments, two required: regex and view, and two optional: kwargs, and name.
  4. Each view is responsible for doing one of two things: returning an HttpResponse object containing the content for the requested page, or raising an exception such as Http404.

posted on 2013-07-11 23:57  Hjärtat  阅读(131)  评论(0编辑  收藏  举报

导航