title: Setup wsgi.py at pythonanywhere
body: <p>I have wsgi.py problem, can anyone help me with this?</p>
  <p>My breadcrumb structure is: <a href="https://www.pythonanywhere.com/user/alinecatikoc/files/var/www/alinecatikoc_pythonanywhere_com_wsgi.py?edit" rel="nofollow noreferrer">https://www.pythonanywhere.com/user/alinecatikoc/files/var/www/alinecatikoc_pythonanywhere_com_wsgi.py?edit</a></p>
  <p>My <code>wsgi.py</code> file inside is like this:</p>
  <pre><code>import sys
  #
  ## The &quot;/home/alinecatikoc&quot; below specifies your home
  ## directory -- the rest should be the directory you uploaded your Flask
  ## code to underneath the home directory.  So if you just ran
  ## &quot;git clone git@github.com/myusername/myproject.git&quot;
  ## ...or uploaded files to the directory &quot;myproject&quot;, then you should
  ## specify &quot;/home/alinecatikoc/myproject&quot;
  path = '/home/alinecatikoc/flaskai/app.py'
  if path not in sys.path:
     sys.path.insert(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 flaskai import app as application
  application = app
  </code></pre>
  <p>My error log is at the <a href="https://www.pythonanywhere.com/user/alinecatikoc/files/var/log/alinecatikoc.pythonanywhere.com.error.log" rel="nofollow noreferrer">https://www.pythonanywhere.com/user/alinecatikoc/files/var/log/alinecatikoc.pythonanywhere.com.error.log</a>:</p>
  <pre><code>2022-08-11 19:31:47,880: Error running WSGI application
  2022-08-11 19:31:47,882: NameError: name 'app' is not defined
  2022-08-11 19:31:47,883:   File &quot;/var/www/alinecatikoc_pythonanywhere_com_wsgi.py&quot;, line 89, in &lt;module&gt;
  2022-08-11 19:31:47,883:     application = app
  2022-08-11 19:31:47,883: ***************************************************
  2022-08-11 19:31:47,883: If you're seeing an import error and don't know why,
  2022-08-11 19:31:47,883: we have a dedicated help page to help you debug: 
  2022-08-11 19:31:47,883: https://help.pythonanywhere.com/pages/DebuggingImportError/
  2022-08-11 19:31:47,883: ***************************************************
  2022-08-11 19:31:52,038: Error running WSGI application
  2022-08-11 19:31:52,038: NameError: name 'app' is not defined
  2022-08-11 19:31:52,038:   File &quot;/var/www/alinecatikoc_pythonanywhere_com_wsgi.py&quot;, line 89, in &lt;module&gt;
  2022-08-11 19:31:52,039:     application = app
  2022-08-11 19:31:52,039: ***************************************************
  2022-08-11 19:31:52,039: If you're seeing an import error and don't know why,
  2022-08-11 19:31:52,039: we have a dedicated help page to help you debug: 
  2022-08-11 19:31:52,039: https://help.pythonanywhere.com/pages/DebuggingImportError/
  2022-08-11 19:31:52,039: ***************************************************
  2022-08-11 19:39:16,449: Error running WSGI application
  2022-08-11 19:39:16,450: TypeError: 'module' object is not callable
  2022-08-11 19:39:25,030: Error running WSGI application
  2022-08-11 19:39:25,032: TypeError: 'module' object is not callable
  2022-08-11 19:39:26,579: Error running WSGI application
  2022-08-11 19:39:26,579: TypeError: 'module' object is not callable
  </code></pre>
  <p>My problem is, first, the website doesn't work. Second is I can not figure it out will be my sqlalchemy and db work or not?</p>
  <p>and finally my file structure is:</p>
  <pre><code>/home/
    alinecatikoc/
      flaskai/
        app.py
        requirements.txt
        aiusers.db
        .env
        .emv
        .gitignore
  </code></pre>
  <p>Thank you for your kind help.</p>