I use dotenv to access stored environmentals in a .env in a directory with my project files. The flask config and init run with no errors and the server displays my home page when I type my custom domain name. The problem is when I try fo load a flask-wtf form into a template, I get the above error. What will resolve this issue?
I created my vitual environment in a bash console from the dashboard Here is my wsgi.py file:
import sys
import os
from dotenv import load_dotenv
project_folder = os.path.expanduser('~/home/trapdoor/fishing/daf') # adjust as appropriate
load_dotenv(os.path.join(project_folder, '.env'))
# add your project directory to the sys.path
project_home = '/home/trapdoor/fishing/'
if project_home not in sys.path:
sys.path = [project_home] + sys.path
# import flask app but need to call it "application" for WSGI to work
from daf import create_app # noqa
application = create_app()
[edit by admin for formatting]