Forums

WSGI file is not updating or the error logs are not updating

.

2022-04-19 23:27:11,241: ImportError: cannot import name 'create_app' from 'my_frame_website' (unknown location)
File "/var/www/troy_pythonanywhere_com_wsgi.py", line 83, in from my_frame_website import create_app

I've updated my wsgi file including adding env variables and clicked save and refresh, but the error log remains the same and line 83 isn't even from my_frame_website import create_app anymore.

import sys

path = '/home/troy/my_frame_website'
if path not in sys.path:
    sys.path.append(path)

import os
from dotenv import load_dotenv
project_folder = os.path.expanduser(path)  # adjust as appropriate
load_dotenv(os.path.join(project_folder, '.env'))

from my_frame import create_app
application = create_app()

Make sure the error log file is reloaded (if you had it open in a browser tab) and you're looking at the bottom of it (the newer entries are being appended, not prepended).