Skip to content

Commit e82200b

Browse files
committed
INTPYTHON-789 Document how to configure contrib apps with models
1 parent 781e710 commit e82200b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/howto/contrib-apps.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ Configuring Django's contrib apps
55
Generally, Django's contribs app work out of the box, but here are some
66
required adjustments.
77

8+
Apps with models
9+
================
10+
11+
Each contrib app that has models that use :class:`~django.db.models.AutoField`
12+
(:mod:`~django.contrib.admin`, :mod:`~django.contrib.auth`,
13+
:mod:`~django.contrib.contenttypes`, :mod:`~django.contrib.flatpages`,
14+
:mod:`~django.contrib.redirects`, and :mod:`~django.contrib.sites`) must:
15+
16+
#. Be configured with an ``AppConfig`` that specifies
17+
``default_auto_field = "django_mongodb_backend.fields.ObjectIdAutoField"``.
18+
See :ref:`specifying the-default-pk-field`.
19+
#. Have migrations that use :class:`.ObjectIdAutoField`. See
20+
:ref:`configuring-migrations`.
21+
822
``contrib.sites``
923
=================
1024

docs/intro/configure.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Each app reference in the :setting:`INSTALLED_APPS` setting must point to the
5353
corresponding ``AppConfig``. For example, instead of ``'django.contrib.admin'``,
5454
the template uses ``'<project_name>.apps.MongoAdminConfig'``.
5555

56+
.. _configuring-migrations:
57+
5658
Configuring migrations
5759
======================
5860

0 commit comments

Comments
 (0)