Skip to Content
Django 3 Web Development Cookbook - Fourth Edition
book

Django 3 Web Development Cookbook - Fourth Edition

by Aidas Bendoraitis, Jake Kronika
March 2020
Intermediate to advanced
608 pages
17h 17m
English
Packt Publishing
Content preview from Django 3 Web Development Cookbook - Fourth Edition

How to do it...

To connect Auth0 to your Django project, follow these steps:

  1. Add the social authentication app to INSTALLED_APPS in the settings file, like so:
# myproject/settings/_base.pyINSTALLED_APPS = [    # …    "social_django",]
  1. Now, add the Auth0 settings required by the social_django app, which will be similar to the following:
# myproject/settings/_base.pySOCIAL_AUTH_AUTH0_DOMAIN = get_secret("AUTH0_DOMAIN")SOCIAL_AUTH_AUTH0_KEY = get_secret("AUTH0_KEY")SOCIAL_AUTH_AUTH0_SECRET = get_secret("AUTH0_SECRET")SOCIAL_AUTH_AUTH0_SCOPE = ["openid", "profile", "email"]SOCIAL_AUTH_TRAILING_SLASH = False

Make sure that you define AUTH0_DOMAIN, AUTH0_KEY, and AUTH0_SECRET in your secrets or environment variables. The values for those variables ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Django 2 Web Development Cookbook - Third Edition

Django 2 Web Development Cookbook - Third Edition

Jake Kronika, Aidas Bendoraitis

Publisher Resources

ISBN: 9781838987428Supplemental Content