1

我从 django 开始,正在努力在我的网站上实施 django-allauth。

我感兴趣的关键:

  • 谷歌
  • 领英
  • Facebook

据我了解,我需要向每个提供商注册我的应用程序才能获取 API 密钥和令牌。

在这些提供者网站上,注册应用程序时会询问项目名称和项目 URL。

问题是如果我想首先在我的本地机器上运行我的网站,我需要单独注册我的本地主机吗?如果是这样,项目名称和项目 URL 应该是什么?

4

1 回答 1

3

You can set the localhost in your social apps, for example in Facebook App:

Display Name: My project
Namespace: myproject_test
Site URL: http://127.0.0.1:8000
Canvas URL: http://127.0.0.1:8000/
Secure Canvas URL: https://127.0.0.1:8000/

And when you deploy your site you have to change the settings according to your domain on which you host your site.

In django-allauth after getting the Key and Secret of your app you have to login to admin in your project and go to http://127.0.0.1:8000/admin/socialaccount/socialapp/ to add the provider there before using it.

于 2012-11-30T11:54:29.973 回答