Forums

Error running WSGI application

hello I trying to upload the website project in pythonanywhrere for my graduation project, and I get these errors, I update Django and python-decouple and did not fix it

2021-11-23 08:11:18,859: Error running WSGI application
    2021-11-23 08:11:18,874: decouple.UndefinedValueError: EADDRESS not found. Declare it as envvar or define a default value.
    2021-11-23 08:11:18,874:   File "/var/www/salehkhalid_pythonanywhere_com_wsgi.py", line 25, in <module>
    2021-11-23 08:11:18,874:     application = get_wsgi_application()
    2021-11-23 08:11:18,874: 
    2021-11-23 08:11:18,874:   File "/home/salehkhalid/.virtualenvs/Django-Doctor-Website-virtualen/lib/python3.7/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    2021-11-23 08:11:18,875:     django.setup(set_prefix=False)
    2021-11-23 08:11:18,875: 
    2021-11-23 08:11:18,875:   File "/home/salehkhalid/.virtualenvs/Django-Doctor-Website-virtualen/lib/python3.7/site-packages/django/__init__.py", line 19, in setup
    2021-11-23 08:11:18,875:     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
    2021-11-23 08:11:18,875: 
    2021-11-23 08:11:18,875:   File "/home/salehkhalid/.virtualenvs/Django-Doctor-Website-virtualen/lib/python3.7/site-packages/django/conf/__init__.py", line 82, in __getattr__
    2021-11-23 08:11:18,875:     self._setup(name)
    2021-11-23 08:11:18,875: 
    2021-11-23 08:11:18,875:   File "/home/salehkhalid/.virtualenvs/Django-Doctor-Website-virtualen/lib/python3.7/site-packages/django/conf/__init__.py", line 69, in _setup
    2021-11-23 08:11:18,875:     self._wrapped = Settings(settings_module)
    2021-11-23 08:11:18,875: 
    2021-11-23 08:11:18,875:   File "/home/salehkhalid/.virtualenvs/Django-Doctor-Website-virtualen/lib/python3.7/site-packages/django/conf/__init__.py", line 170, in __init__
    2021-11-23 08:11:18,876:     mod = importlib.import_module(self.SETTINGS_MODULE)
    2021-11-23 08:11:18,876: 
    2021-11-23 08:11:18,876:   File "/home/salehkhalid/Django-Doctor-Website/django/project/settings.py", line 128, in <module>
    2021-11-23 08:11:18,876:     EMAIL_HOST_USER = config("EADDRESS")
    2021-11-23 08:11:18,876: 
    2021-11-23 08:11:18,876:   File "/home/salehkhalid/.virtualenvs/Django-Doctor-Website-virtualen/lib/python3.7/site-packages/decouple.py", line 199, in __call__
    2021-11-23 08:11:18,876:     return self.config(*args, **kwargs)
    2021-11-23 08:11:18,876: 
    2021-11-23 08:11:18,876:   File "/home/salehkhalid/.virtualenvs/Django-Doctor-Website-virtualen/lib/python3.7/site-packages/decouple.py", line 83, in __call__
    2021-11-23 08:11:18,876:     return self.get(*args, **kwargs)
    2021-11-23 08:11:18,876: 
    2021-11-23 08:11:18,876:   File "/home/salehkhalid/.virtualenvs/Django-Doctor-Website-virtualen/lib/python3.7/site-packages/decouple.py", line 68, in get
    2021-11-23 08:11:18,877:     raise UndefinedValueError('{} not found. Declare it as envvar or define a default value.'.format(option))

this is my wsgi.py

# /home/salehkhalid/Django-Doctor-Website/django


# This file contains the WSGI configuration required to serve up your
# web application at http://sadataii.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/salehkhalid/Django-Doctor-Website/django'
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'] = 'project.settings'

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

could anybody help me

It looks like decouple is complaining that you're trying to use a value EADDRESS that you have not set:

decouple.UndefinedValueError: EADDRESS not found. Declare it as envvar or define a default value.

Make sure that you set the value.