Search code examples
pythondjangogoogle-apipythonanywheredjango-login

Error Running WSGI application - client_secrets.json


I´m making a web app with django, but when I run the application, I´m getting this error:

error.log

I have uploaded my client_secrets.json file in the project path and I´m sure I have no typos

Settings.py

GOOGLE_OAUTH2_CLIENT_SECRETS_JSON = 'client_secrets.json'

WSGI.py

# This file contains the WSGI configuration required to serve up your
# web application at http://bohosul02.pythonanywhere.com/
# It works by setting the variable 'application' to a WSGI handler of some
# description.
#
# The below has been auto-generated for your Django project

import os
import sys

# add your project directory to the sys.path
project_home = '/home/bohosul02/misitio'
if project_home not in sys.path:
    sys.path.insert(0, project_home)

# set environment variable to tell django where your settings.py is
os.environ['DJANGO_SETTINGS_MODULE'] = 'gfglogin.settings'

# serve django via WSGI
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Solution

  • You're using a relative path name (client_secrets.json) without paying attention to what your working directory is. If you use the full path to the file, then it will be able to find it.