Skip to content

Instantly share code, notes, and snippets.

@mkouhei
Last active August 29, 2015 14:28
Show Gist options
  • Select an option

  • Save mkouhei/f1e7a2be50aafbda20ba to your computer and use it in GitHub Desktop.

Select an option

Save mkouhei/f1e7a2be50aafbda20ba to your computer and use it in GitHub Desktop.
INSTALLED_APPS = (
(snip)
'django_auth_custom_example', # <--
)
MIDDLEWARE_CLASSES = (
(snip)
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_auth_custom_example.middleware.CustomAuthMiddleware', # <--
(snip)
)
AUTHENTICATION_BACKENDS = (
(snip)
'django_auth_custom_example.backends.CustomAuthBackend', # <--
'django.contrib.auth.backends.ModelBackend',
(snip)
)
# for django REST framework
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'django_auth_custom_example.authentication.TokenAuthentication', # <--
(snip)
'rest_framework.authentication.SessionAuthentication',
),
(snip)
}
AUTH_CUSTOM_SERVER_URI = 'http://example.org/v1/auth' # <--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment