File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff 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' ,
Original file line number Diff line number Diff 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
3644Django processes authentication backends.
You can’t perform that action at this time.
0 commit comments