summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2016-09-10 16:38:05 -0700
committerGitHub <noreply@github.com>2016-09-10 16:38:05 -0700
commit1ec1633cb294d8ce2a65ece6b56c258483596fba (patch)
tree49e7163dad4220da3d99be0a5d981a1a735570a3 /docs
parent0368d63a78b07e794138a65216b91eadbb47fc2f (diff)
Fixed #26401 -- Added BaseAuthConfig to use auth without migrations.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/auth.txt17
-rw-r--r--docs/releases/1.11.txt4
-rw-r--r--docs/topics/auth/customizing.txt25
3 files changed, 46 insertions, 0 deletions
diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt
index 91e3fbd1ba..f12b16daa0 100644
--- a/docs/ref/contrib/auth.txt
+++ b/docs/ref/contrib/auth.txt
@@ -645,3 +645,20 @@ The following backends are available in :mod:`django.contrib.auth.backends`:
Same as :class:`RemoteUserBackend` except that it doesn't reject inactive
users because :attr:`~RemoteUserBackend.user_can_authenticate` always
returns ``True``.
+
+``AppConfig`` classes
+=====================
+
+.. module:: django.contrib.auth.apps
+ :synopsis: AppConfigs for contrib.auth.
+
+.. class:: AuthConfig
+
+ The default :class:`~django.apps.AppConfig`.
+
+.. class:: BaseAuthConfig
+
+ .. versionadded:: 1.11
+
+ An :class:`~django.apps.AppConfig` for use if you :ref:`aren't using
+ <using-auth-without-models>` any of the built-in ``contrib.auth`` models.
diff --git a/docs/releases/1.11.txt b/docs/releases/1.11.txt
index 49540a320a..b2ba159c8a 100644
--- a/docs/releases/1.11.txt
+++ b/docs/releases/1.11.txt
@@ -109,6 +109,10 @@ Minor features
* Added password validators ``help_text`` to
:class:`~django.contrib.auth.forms.UserCreationForm`.
+* The new :class:`~django.contrib.auth.apps.BaseAuthConfig` ``AppConfig``
+ allows using the authentication system :ref:`without any of the built-in
+ models <using-auth-without-models>`.
+
:mod:`django.contrib.contenttypes`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt
index db18bfb8c2..d102d9939b 100644
--- a/docs/topics/auth/customizing.txt
+++ b/docs/topics/auth/customizing.txt
@@ -1133,3 +1133,28 @@ Finally, specify the custom model as the default user model for your project
using the :setting:`AUTH_USER_MODEL` setting in your ``settings.py``::
AUTH_USER_MODEL = 'customauth.MyUser'
+
+.. _using-auth-without-models:
+
+Using ``contrib.auth`` without the built-in models
+==================================================
+
+The models shipped with ``contrib.auth`` may not be required. For example, if
+you :ref:`customize the user model <auth-custom-user>` and don't use the
+:class:`~django.contrib.auth.models.Permission` and
+:class:`~django.contrib.auth.models.Group` models, then the ``auth`` tables
+may be unused. To avoid creating these tables, modify the
+:setting:`MIGRATION_MODULES` setting and disable the migrations for the
+``auth`` app::
+
+ MIGRATION_MODULES = {'auth': None}
+
+To prevent creation of the default permissions, change ``'django.contrib.auth'``
+in :setting:`INSTALLED_APPS` to
+:class:`django.contrib.auth.apps.BaseAuthConfig`::
+
+ INSTALLED_APPS = [
+ ...
+ 'django.contrib.auth.apps.BaseAuthConfig',
+ ...
+ ]