Notes for Studying Django
- 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.
- 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.
- The url() function is passed four arguments, two required: regex and view, and two optional: kwargs, and name.
- 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.