reading-notes


Project maintained by will-ing Hosted on GitHub Pages — Theme by mattgraham

Django Models

Models define the structure of stored data, including the field types and possibly also their maximum size, default values, selection list options, help text for documentation, label text for forms, etc.

Fields

A model can have an arbitrary number of fields, of any type — each one represents a column

Common Field Arguments

Common Field Types

Metadata

You can declare model-level metadata for your Model by declaring class Meta,

A model can also have methods.

Registering Models

You can create a superuser by running:

python3 manage.py createsuperuser
  1. To login use /admin URL
  2. Click Add
  3. When your finished adding click home

Main Page