Skip to content

Commit 14b8309

Browse files
committed
Update documentation for Django 1.10 style middleware
Touches #449
1 parent c90cd05 commit 14b8309

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

docs/tutorial/tutorial_01.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ Include the CORS middleware in your `settings.py`:
4343

4444
.. code-block:: python
4545
46+
MIDDLEWARE = (
47+
# ...
48+
'corsheaders.middleware.CorsMiddleware',
49+
# ...
50+
)
51+
52+
# Or on Django < 1.10:
4653
MIDDLEWARE_CLASSES = (
4754
# ...
4855
'corsheaders.middleware.CorsMiddleware',

docs/tutorial/tutorial_03.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ which takes care of token verification. In your settings.py:
2222
'...',
2323
)
2424
25-
MIDDLEWARE_CLASSES = (
25+
MIDDLEWARE = (
2626
'...',
2727
# If you use SessionAuthenticationMiddleware, be sure it appears before OAuth2TokenMiddleware.
2828
# SessionAuthenticationMiddleware is NOT required for using django-oauth-toolkit.
@@ -31,6 +31,14 @@ which takes care of token verification. In your settings.py:
3131
'...',
3232
)
3333
34+
# Or on Django<1.10:
35+
MIDDLEWARE_CLASSES = (
36+
'...',
37+
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
38+
'oauth2_provider.middleware.OAuth2TokenMiddleware',
39+
'...',
40+
)
41+
3442
You will likely use the `django.contrib.auth.backends.ModelBackend` along with the OAuth2 backend
3543
(or you might not be able to log in into the admin), only pay attention to the order in which
3644
Django processes authentication backends.

0 commit comments

Comments
 (0)