@@ -43,7 +43,9 @@ Run this command to install ``django-mail-auth``::
43
43
Setup
44
44
-----
45
45
46
- First add ``mailauth `` to you installed apps::
46
+ First add ``mailauth `` to you installed apps:
47
+
48
+ .. code-block :: python
47
49
48
50
INSTALLED_APPS = [
49
51
# Django's builtin apps…
@@ -64,7 +66,8 @@ First add ``mailauth`` to you installed apps::
64
66
with token based authentication too.
65
67
66
68
``mailauth.contrib.user `` is optional and provides a new Django User model.
67
- The new User model needs to be enabled via the ``AUTH_USER_MODEL `` setting::
69
+ The new User model needs to be enabled via the ``AUTH_USER_MODEL `` setting:
70
+ .. code-block :: python
68
71
69
72
# This setting should be either "EmailUser" or
70
73
# any custom subclass of "AbstractEmailUser"
@@ -74,7 +77,9 @@ The new User model needs to be enabled via the ``AUTH_USER_MODEL`` setting::
74
77
WAGTAILUSERS_PASSWORD_ENABLED = False
75
78
76
79
77
- Next you will need to add the new authentication backend::
80
+ Next you will need to add the new authentication backend:
81
+
82
+ .. code-block :: python
78
83
79
84
AUTHENTICATION_BACKENDS = (
80
85
# default, but now optional
@@ -89,7 +94,9 @@ Next you will need to add the new authentication backend::
89
94
Django's ``ModelBackend `` is only needed, if you still want to support
90
95
password based authentication. If you don't, simply remove it from the list.
91
96
92
- Last but not least, go to your URL root configuration ``urls.py `` and add the following::
97
+ Last but not least, go to your URL root configuration ``urls.py `` and add the following:
98
+
99
+ .. code-block :: python
93
100
94
101
from django.urls import path
95
102
@@ -107,12 +114,12 @@ That's it!
107
114
108
115
.. |version | image :: https://img.shields.io/pypi/v/django-mail-auth.svg
109
116
:target: https://pypi.python.org/pypi/django-mail-auth/
110
- .. |ci | image :: https://travis-ci.com/codingjoe/django-mail-auth.svg?branch=master
117
+ .. |ci | image :: https://travis-ci.com/codingjoe/django-mail-auth.svg?branch=main
111
118
:target: https://travis-ci.com/codingjoe/django-mail-auth
112
- .. |coverage | image :: https://codecov.io/gh/codingjoe/django-mail-auth/branch/master /graph/badge.svg
119
+ .. |coverage | image :: https://codecov.io/gh/codingjoe/django-mail-auth/branch/main /graph/badge.svg
113
120
:target: https://codecov.io/gh/codingjoe/django-mail-auth
114
121
.. |license | image :: https://img.shields.io/badge/license-MIT-blue.svg
115
- :target: :target: https://raw.githubusercontent.com/codingjoe/django-mail-auth/master /LICENSE
122
+ :target: :target: https://raw.githubusercontent.com/codingjoe/django-mail-auth/main /LICENSE
116
123
.. |docs | image :: https://readthedocs.org/projects/django-mail-auth/badge/?version=latest
117
124
:target: https://django-mail-auth.readthedocs.io/en/latest/?badge=latest
118
125
:alt: Documentation Status
0 commit comments