Django: Beyond the SQL: Create your models

  1. Installation
  2. Beyond the SQL
  3. Create your administration models

http://docs.djangoproject.com/en/dev/topics/db/models/

Each table in your database is modeled using a class in Python. Django sets up an empty “models.py” file that you should use for these models. We’ll set up a very basic blog in models.py. It will have posts, authors, and topics.

The first thing you need to do is create an app. An app is a collection of related models. Our tutorial Blog will only have one app, “postings”.

python manage.py startapp postings

This creates a new folder, postings, with models.py and views.py, among other files.

  1. Installation
  2. Beyond the SQL
  3. Create your administration models