【问题标题】:Django-allauth google authentication not working in production (apache2 + mod_wsgi)Django-allauth google 身份验证在生产中不起作用(apache2 + mod_wsgi)
【发布时间】:2017-10-06 19:47:09
【问题描述】:

我已经使用 apache 和 mod_wsgi 在我的学院服务器上部署了我的 django web 应用程序,并且我正在使用 django-allauth google 身份验证。我的研究所网络使用很少的代理服务器与 Internet 交互。

当我在 localhost 上运行应用程序时,Google 身份验证工作正常,但是一旦我将应用程序迁移到 https_://fusion.*******.ac.in,Google 身份验证就会显示如下

Error image

回调 uri:https_://fusion.*******.ac.in/accounts/google/login/callback/

请帮我解决这个问题。

【问题讨论】:

  • 您是否在 Google API 凭据中添加了生产回调 url,即 https://fusion.xxxx.ac.in/login/redirect/
  • @JerinPeterGeorge,和https://fusion.xxxx.ac.in/accounts/google/login/callback/ 有区别吗?

标签: django apache django-allauth


【解决方案1】:

在您的 wsgi 文件中添加以下行。

import os

http_proxy  = "host:port"
https_proxy = "host:port"
ftp_proxy   = "host:port"

proxyDict = { 
 "http"  : http_proxy, 
 "https" : https_proxy, 
 "ftp"   : ftp_proxy
}

os.environ["PROXIES"] = proxyDict

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-02
    • 2021-01-19
    • 2015-07-21
    • 2017-07-16
    • 2015-10-12
    • 2015-09-17
    • 1970-01-01
    • 2018-12-25
    相关资源
    最近更新 更多