title: Successful build of Heroku Python App but execution is unsuccessful and open app throws error
body: <p>I recently successfully deployed a Heroku app(view log below for details), but when I try to access my app through a browser, it returns with <code>An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command heroku logs --tail</code>. Furthermore, my app was for a Discord.Py bot, and the bot was not online like it should be.</p>
  <p><strong>Logs:</strong></p>
  <pre class="lang-py prettyprint-override"><code>-----&gt; Building on the Heroku-20 stack
  -----&gt; Using buildpack: heroku/python
  -----&gt; Python app detected
  -----&gt; No Python version was specified. Using the same version as the last build: python-3.9.9
         To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
  -----&gt; Requirements file has been changed, clearing cached dependencies
  -----&gt; Installing python-3.9.9
  -----&gt; Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
  -----&gt; Installing SQLite3
  -----&gt; Installing requirements with pip
         Collecting discord.py==1.6.0
           Downloading discord.py-1.6.0-py3-none-any.whl (779 kB)
         Collecting Flask==2.0.2
           Downloading Flask-2.0.2-py3-none-any.whl (95 kB)
         Collecting dnspython==1.16.0
           Downloading dnspython-1.16.0-py2.py3-none-any.whl (188 kB)
         Collecting PyNaCl==1.3.0
           Downloading PyNaCl-1.3.0-cp34-abi3-manylinux1_x86_64.whl (759 kB)
         Collecting async-timeout==3.0.1
           Downloading async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
         Collecting aiohttp&lt;3.8.0,&gt;=3.6.0
           Downloading aiohttp-3.7.4.post0-cp39-cp39-manylinux2014_x86_64.whl (1.4 MB)
         Collecting Jinja2&gt;=3.0
           Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
         Collecting itsdangerous&gt;=2.0
           Downloading itsdangerous-2.0.1-py3-none-any.whl (18 kB)
         Collecting Werkzeug&gt;=2.0
           Downloading Werkzeug-2.0.2-py3-none-any.whl (288 kB)
         Collecting click&gt;=7.1.2
           Downloading click-8.0.3-py3-none-any.whl (97 kB)
         Collecting cffi&gt;=1.4.1
           Downloading cffi-1.15.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (444 kB)
         Collecting six
           Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
         Collecting yarl&lt;2.0,&gt;=1.0
           Downloading yarl-1.7.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (304 kB)
         Collecting attrs&gt;=17.3.0
           Downloading attrs-21.4.0-py2.py3-none-any.whl (60 kB)
         Collecting chardet&lt;5.0,&gt;=2.0
           Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
         Collecting typing-extensions&gt;=3.6.5
           Downloading typing_extensions-4.0.1-py3-none-any.whl (22 kB)
         Collecting multidict&lt;7.0,&gt;=4.5
           Downloading multidict-5.2.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (174 kB)
         Collecting pycparser
           Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
         Collecting MarkupSafe&gt;=2.0
           Downloading MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
         Collecting idna&gt;=2.0
           Downloading idna-3.3-py3-none-any.whl (61 kB)
         Installing collected packages: multidict, idna, yarl, typing-extensions, pycparser, MarkupSafe, chardet, attrs, async-timeout, Werkzeug, six, Jinja2, itsdangerous, click, cffi, aiohttp, PyNaCl, Flask, dnspython, discord.py
         Successfully installed Flask-2.0.2 Jinja2-3.0.3 MarkupSafe-2.0.1 PyNaCl-1.3.0 Werkzeug-2.0.2 aiohttp-3.7.4.post0 async-timeout-3.0.1 attrs-21.4.0 cffi-1.15.0 chardet-4.0.0 click-8.0.3 discord.py-1.6.0 dnspython-1.16.0 idna-3.3 itsdangerous-2.0.1 multidict-5.2.0 pycparser-2.21 six-1.16.0 typing-extensions-4.0.1 yarl-1.7.2
  -----&gt; Discovering process types
         Procfile declares types -&gt; worker
  -----&gt; Compressing...
         Done: 62M
  -----&gt; Launching...
         Released v5
         https://app.herokuapp.com/ deployed to Heroku
  </code></pre>