I am trying to deploy my flask app but i am running into errors

Traceback (most recent call last):

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/util.py”, line 414, in import_app

Jul 31 10:04:28 AM app = getattr(mod, name)

Jul 31 10:04:28 AM ^^^^^^^^^^^^^^^^^^

Jul 31 10:04:28 AMAttributeError: module ‘app’ has no attribute ‘app’

Jul 31 10:04:28 AM

Jul 31 10:04:28 AMDuring handling of the above exception, another exception occurred:

Jul 31 10:04:28 AM

Jul 31 10:04:28 AMTraceback (most recent call last):

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/bin/gunicorn”, line 8, in

Jul 31 10:04:28 AM sys.exit(run())

Jul 31 10:04:28 AM ^^^^^

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py”, line 67, in run

Jul 31 10:04:28 AM WSGIApplication(“%(prog)s [OPTIONS] [APP_MODULE]”, prog=prog).run()

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/app/base.py”, line 236, in run

Jul 31 10:04:28 AM super().run()

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/app/base.py”, line 72, in run

Jul 31 10:04:28 AM Arbiter(self).run()

Jul 31 10:04:28 AM ^^^^^^^^^^^^^

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/arbiter.py”, line 58, in init

Jul 31 10:04:28 AM self.setup(app)

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/arbiter.py”, line 118, in setup

Jul 31 10:04:28 AM self.app.wsgi()

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/app/base.py”, line 67, in wsgi

Jul 31 10:04:28 AM self.callable = self.load()

Jul 31 10:04:28 AM ^^^^^^^^^^^

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py”, line 58, in load

Jul 31 10:04:28 AM return self.load_wsgiapp()

Jul 31 10:04:28 AM ^^^^^^^^^^^^^^^^^^^

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py”, line 48, in load_wsgiapp

Jul 31 10:04:28 AM return util.import_app(self.app_uri)

Jul 31 10:04:28 AM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Jul 31 10:04:28 AM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/util.py”, line 418, in import_app

Jul 31 10:04:28 AM raise AppImportError(“Failed to find attribute %r in %r.” % (name, module))

Jul 31 10:04:28 AMgunicorn.errors.AppImportError: Failed to find attribute ‘app’ in ‘app’.

Try installing nodemon package if it is intended

should i add it to my requirments.txt file?

Yes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.