简体   繁体   中英

How to do the last three steps in a Django allauth post-installation?

I saw someone else had an issue at the same part over a year ago, but no answer was found.

I don't know what these last three steps need of me.

  1. Add a Site for your domain, matching settings.SITE_ID (django.contrib.sites app).
  2. For each OAuth based provider, add a Social App (socialaccount app).
  3. Fill in the site and the OAuth app credentials obtained from the provider.

Here are my questions:

  1. What site do I need to add? I'm in development, and have no domain name, do I use my local http://127.0.0.1:8000/

  2. Second part asks for: (I don't know what to enter for any of these)

    • User
    • provider
    • uid
  3. Third part asks for:

    • provider, a drop down from the ones I added to installed apps (that shows up)
    • client id (where do I get this from Google / Facebook)
    • secret key (where do I get this from Google / Facebook)
    • asks me to add site (the one I don't know what info to add in first step)

I looked for other instructions, or guides, but didn't find anything useful.

I am using Django 1.9 and Python 3.5.

If memory serves, django-allauth and python social auth are similar enough that this should still be useful

  1. For hostname, you can do one of two things:

    1. use 127.0.0.1:8080 (though I think at least some providers will complain)
    2. use sierra.kilo.com:8080 and put that in your /etc/hosts file (or the windows equivalent) for development
  2. I would suggest picking one provider to start if memory serves, google was slightly pickier than twitter for my configuration; have not used facebook.

  3. This is going to depend on the provider... for twitter, go to https://apps.twitter.com/ to register your app and therefore get the client id / secret key (and therefore add the site). For google, https://console.developers.google.com/projectselector/apis/credentials is your starting point to register your project and get the credentials

(Just saw comment, which obviates the part I spent time on, but hopefully point 1 at least is useful for that part of the question)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM