November 2015
Beginner to intermediate
840 pages
26h 30m
English
FlatPageIn Example 15.7, we import the FlatPage model into our shell along with the Site model from the sites app.
Example 15.7: Python Interpreter Code
>>> from django.contrib.sites.models import Site >>> from django.contrib.flatpages.models import FlatPage
We’ve taken the name spaced string from our settings, django.contrib.app_name, and simply suffixed models. The contributed apps that Django supplies follow the same conventions as developer-created apps. Opening either of the files found at django/contrib/sites/models.py or django/contrib/flatpages/models.py allows us to read the source code for either the Site or FlatPage model class.
The Site model is simple, and we don’t actually ...
Read now
Unlock full access