Search code examples
djangoapachedjango-allauth

Django-allauth google authentication not working in production (apache2 + mod_wsgi)


I have deployed my django web application on my institute server using apache and mod_wsgi and I am using django-allauth google authentication. My institute network uses few proxy servers to interact with the Internet.

Google authentication works fine while I am running app on localhost, but as soon as I migrate the app to https_://fusion.*******.ac.in, google authentication shows following

Error image

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

Please help me with this problem.


Solution

  • Add following lines in your wsgi file.

    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