Deploy Python Modules on Heroku? - python-2.7

I have a problem deploying python modules on Heroku.
It's based on python2.
requirements.txt file:
Flask==0.11.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.10
click==6.6
gunicorn==19.6.0
itsdangerous==0.24
requests==2.10.0
wsgiref==0.1.2
konlpy==0.4.4
gensim==2.1.0
The modules that I'm having trouble uploading is konlpy and gensim.
I already installed all the modules on virtual environment. I also set the buildpack for gensim (not konlpy).
The error log is:
2017-06-10T08:56:17.851884+00:00 app[web.1]: [2017-06-10 08:56:17 +0000] [4] [INFO] Shutting down: Master
2017-06-10T08:56:17.851975+00:00 app[web.1]: [2017-06-10 08:56:17 +0000] [4] [INFO] Reason: Worker failed to boot.
2017-06-10T08:56:17.946195+00:00 heroku[web.1]: State changed from starting to crashed
2017-06-10T08:56:17.936020+00:00 heroku[web.1]: Process exited with status 3
2017-06-10T08:56:55.589601+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/" host=afternoon-beach-22534.herokuapp.com request_id=8e14e22a-b473-4aa8-959e-c26a80f8775e fwd="69.63.188.105" dyno= connect= service= status=503 bytes= protocol=https
2017-06-10T08:58:15.541365+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/" host=afternoon-beach-22534.herokuapp.com request_id=1bd4f45b-1db6-4e24-be10-28b0b62b7c40 fwd="173.252.124.202" dyno= connect= service= status=503 bytes= protocol=https
2017-06-10T08:59:04.103999+00:00 heroku[web.1]: State changed from crashed to starting
2017-06-10T08:59:19.881438+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file=-`
2017-06-10T08:59:23.010876+00:00 app[web.1]: [2017-06-10 08:59:23 +0000] [4] [INFO] Starting gunicorn 19.6.0
2017-06-10T08:59:23.012294+00:00 app[web.1]: [2017-06-10 08:59:23 +0000] [4] [INFO] Using worker: sync
2017-06-10T08:59:23.020541+00:00 app[web.1]: [2017-06-10 08:59:23 +0000] [9] [INFO] Booting worker with pid: 9
2017-06-10T08:59:23.089805+00:00 app[web.1]: [2017-06-10 08:59:23 +0000] [11] [INFO] Booting worker with pid: 11
2017-06-10T08:59:23.011687+00:00 app[web.1]: [2017-06-10 08:59:23 +0000] [4] [INFO] Listening at: http://0.0.0.0:42198 (4)
2017-06-10T08:59:23.730044+00:00 heroku[web.1]: Process exited with status 1
2017-06-10T08:59:23.520921+00:00 app[web.1]: [2017-06-10 08:59:23 +0000] [11] [ERROR] Exception in worker process
2017-06-10T08:59:23.520934+00:00 app[web.1]: Traceback (most recent call last):
2017-06-10T08:59:23.520936+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
2017-06-10T08:59:23.520936+00:00 app[web.1]: worker.init_process()
2017-06-10T08:59:23.520937+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
2017-06-10T08:59:23.520938+00:00 app[web.1]: self.load_wsgi()
2017-06-10T08:59:23.520938+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
2017-06-10T08:59:23.520939+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2017-06-10T08:59:23.520940+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2017-06-10T08:59:23.520941+00:00 app[web.1]: self.callable = self.load()
2017-06-10T08:59:23.520941+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2017-06-10T08:59:23.520942+00:00 app[web.1]: return self.load_wsgiapp()
2017-06-10T08:59:23.520942+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2017-06-10T08:59:23.520943+00:00 app[web.1]: return util.import_app(self.app_uri)
2017-06-10T08:59:23.520944+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2017-06-10T08:59:23.520944+00:00 app[web.1]: __import__(module)
2017-06-10T08:59:23.520945+00:00 app[web.1]: File "/app/app.py", line 8, in <module>
2017-06-10T08:59:23.520946+00:00 app[web.1]: from konlpy.tag import Twitter; t = Twitter()
2017-06-10T08:59:23.520947+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/konlpy/tag/_twitter.py", line 72, in __init__
2017-06-10T08:59:23.520947+00:00 app[web.1]: jvm.init_jvm(jvmpath)
2017-06-10T08:59:23.520948+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/konlpy/jvm.py", line 40, in init_jvm
2017-06-10T08:59:23.520949+00:00 app[web.1]: jvmpath = jvmpath or jpype.getDefaultJVMPath()
2017-06-10T08:59:23.520949+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/jpype/_core.py", line 114, in get_default_jvm_path
2017-06-10T08:59:23.520950+00:00 app[web.1]: return finder.get_jvm_path()
2017-06-10T08:59:23.520951+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/jpype/_jvmfinder.py", line 121, in get_jvm_path
2017-06-10T08:59:23.520951+00:00 app[web.1]: jvm = method()
2017-06-10T08:59:23.520952+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/jpype/_jvmfinder.py", line 164, in _get_from_known_locations
2017-06-10T08:59:23.520953+00:00 app[web.1]: for home in self.find_possible_homes(self._locations):
2017-06-10T08:59:23.520954+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/jpype/_jvmfinder.py", line 95, in find_possible_homes
2017-06-10T08:59:23.520954+00:00 app[web.1]: for childname in sorted(os.listdir(parent)):
2017-06-10T08:59:23.520955+00:00 app[web.1]: OSError: [Errno 2] No such file or directory: '/usr/lib/jvm'
2017-06-10T08:59:23.520962+00:00 app[web.1]: [2017-06-10 08:59:23 +0000] [9] [ERROR] Exception in worker process
2017-06-10T08:59:23.520962+00:00 app[web.1]: Traceback (most recent call last):
2017-06-10T08:59:23.520963+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
2017-06-10T08:59:23.520964+00:00 app[web.1]: worker.init_process()
2017-06-10T08:59:23.520964+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
2017-06-10T08:59:23.520965+00:00 app[web.1]: self.load_wsgi()
2017-06-10T08:59:23.520966+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
2017-06-10T08:59:23.520966+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2017-06-10T08:59:23.520967+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2017-06-10T08:59:23.520967+00:00 app[web.1]: self.callable = self.load()
2017-06-10T08:59:23.520968+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2017-06-10T08:59:23.520969+00:00 app[web.1]: return self.load_wsgiapp()
2017-06-10T08:59:23.520969+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2017-06-10T08:59:23.520970+00:00 app[web.1]: return util.import_app(self.app_uri)
2017-06-10T08:59:23.520970+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2017-06-10T08:59:23.520971+00:00 app[web.1]: __import__(module)
2017-06-10T08:59:23.520972+00:00 app[web.1]: File "/app/app.py", line 8, in <module>
2017-06-10T08:59:23.520972+00:00 app[web.1]: from konlpy.tag import Twitter; t = Twitter()
2017-06-10T08:59:23.520973+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/konlpy/tag/_twitter.py", line 72, in __init__
2017-06-10T08:59:23.520974+00:00 app[web.1]: jvm.init_jvm(jvmpath)
2017-06-10T08:59:23.520974+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/konlpy/jvm.py", line 40, in init_jvm
2017-06-10T08:59:23.520975+00:00 app[web.1]: jvmpath = jvmpath or jpype.getDefaultJVMPath()
2017-06-10T08:59:23.520976+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/jpype/_core.py", line 114, in get_default_jvm_path
2017-06-10T08:59:23.520977+00:00 app[web.1]: return finder.get_jvm_path()
2017-06-10T08:59:23.520977+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/jpype/_jvmfinder.py", line 121, in get_jvm_path
2017-06-10T08:59:23.520978+00:00 app[web.1]: jvm = method()
2017-06-10T08:59:23.520979+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/jpype/_jvmfinder.py", line 164, in _get_from_known_locations
2017-06-10T08:59:23.520979+00:00 app[web.1]: for home in self.find_possible_homes(self._locations):
2017-06-10T08:59:23.520980+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/jpype/_jvmfinder.py", line 95, in find_possible_homes
2017-06-10T08:59:23.520981+00:00 app[web.1]: for childname in sorted(os.listdir(parent)):
2017-06-10T08:59:23.520981+00:00 app[web.1]: OSError: [Errno 2] No such file or directory: '/usr/lib/jvm'
2017-06-10T08:59:23.521316+00:00 app[web.1]: [2017-06-10 08:59:23 +0000] [9] [INFO] Worker exiting (pid: 9)
2017-06-10T08:59:23.521493+00:00 app[web.1]: [2017-06-10 08:59:23 +0000] [11] [INFO] Worker exiting (pid: 11)
2017-06-10T08:59:23.552400+00:00 app[web.1]: Traceback (most recent call last):
2017-06-10T08:59:23.552442+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2017-06-10T08:59:23.552493+00:00 app[web.1]: sys.exit(run())
2017-06-10T08:59:23.552512+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2017-06-10T08:59:23.552559+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2017-06-10T08:59:23.552605+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 192, in run
2017-06-10T08:59:23.552667+00:00 app[web.1]: super(Application, self).run()
2017-06-10T08:59:23.552685+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
2017-06-10T08:59:23.552727+00:00 app[web.1]: Arbiter(self).run()
2017-06-10T08:59:23.552769+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 218, in run
2017-06-10T08:59:23.552834+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2017-06-10T08:59:23.552851+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 331, in halt
2017-06-10T08:59:23.552954+00:00 app[web.1]: self.stop()
2017-06-10T08:59:23.552972+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 381, in stop
2017-06-10T08:59:23.553058+00:00 app[web.1]: time.sleep(0.1)
2017-06-10T08:59:23.553101+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 231, in handle_chld
2017-06-10T08:59:23.553166+00:00 app[web.1]: self.reap_workers()
2017-06-10T08:59:23.553182+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 506, in reap_workers
2017-06-10T08:59:23.553314+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2017-06-10T08:59:23.553400+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2017-06-10T08:59:23.748346+00:00 heroku[web.1]: State changed from starting to crashed
2017-06-10T08:59:36.316423+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/" host=afternoon-beach-22534.herokuapp.com request_id=e7341e48-6af5-4d10-8d6d-4a485fdda85c fwd="173.252.124.218" dyno= connect= service= status=503 bytes= protocol=https
2017-06-10T08:59:53.796217+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=afternoon-beach-22534.herokuapp.com request_id=898717bb-1ce1-4c36-97ef-fa844585effb fwd="59.18.254.244" dyno= connect= service= status=503 bytes= protocol=https
What I'm trying to do is deploying word2vec on heroku.
Thank you.

I had the same problem using jpype on Heroku. I got it working by adding the Java buildpack from the Heroku 'Settings' dashboard. Then I added a pom.xml file to the repository and populated it with the code listed here. Then redeploy and jpype should be working. Heroku thinks you're deploying both a Python app and a Java app, so it calls Maven to handle your java code (which doesn't exist :D ) The pom.xml gives Maven something to do during deployment (Heroku fails the deployment if pom.xml doesn't exists or is truly empty), but ultimately doesn't do anything when the app is live...at least that's what I think is happening. In any case JVM should be available for jpype to access. I know this is late but I only ran into this problem today, maybe it helps.
Cheers,
Tim

Related

ModuleNotFoundError: No module named 'games.wsgi' when deploying Django app to heroku

I'm trying to deploy a Django app to heroku. I get an error of ModuleNotFoundError: No module named 'games.wsgi' where games is my project name. My Procfile created is
web: gunicorn games.wsgi . I have installed gunicorn. My requirements.txt is
asgiref==3.3.4
Django==3.2
gunicorn==20.1.0
pytz==2021.1
sqlparse==0.4.1
and pipfile also has [packages] gunicorn = "*"
my wsgi file has os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'games.settings')
my heroku logs show
File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 551, in manage_workers
2021-06-14T10:51:35.947270+00:00 app[web.1]: self.spawn_workers()
2021-06-14T10:51:35.947294+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 623, in spawn_workers
2021-06-14T10:51:35.947812+00:00 app[web.1]: time.sleep(0.1 * random.random())
2021-06-14T10:51:35.947840+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2021-06-14T10:51:35.948243+00:00 app[web.1]: self.reap_workers()
2021-06-14T10:51:35.948270+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2021-06-14T10:51:35.948797+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2021-06-14T10:51:35.949024+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2021-06-14T10:51:35.949049+00:00 app[web.1]:
2021-06-14T10:51:35.949050+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2021-06-14T10:51:35.949050+00:00 app[web.1]:
2021-06-14T10:51:35.949077+00:00 app[web.1]: Traceback (most recent call last):
2021-06-14T10:51:35.949147+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 8, in <module>
2021-06-14T10:51:35.949409+00:00 app[web.1]: sys.exit(run())
2021-06-14T10:51:35.949438+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
2021-06-14T10:51:35.949744+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2021-06-14T10:51:35.949767+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 231, in run
2021-06-14T10:51:35.950117+00:00 app[web.1]: super().run()
2021-06-14T10:51:35.950143+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 72, in run
2021-06-14T10:51:35.950381+00:00 app[web.1]: Arbiter(self).run()
2021-06-14T10:51:35.950404+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 229, in run
2021-06-14T10:51:35.950785+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2021-06-14T10:51:35.950813+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 342, in halt
2021-06-14T10:51:35.951272+00:00 app[web.1]: self.stop()
2021-06-14T10:51:35.951300+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 393, in stop
2021-06-14T10:51:35.951781+00:00 app[web.1]: time.sleep(0.1)
2021-06-14T10:51:35.951810+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2021-06-14T10:51:35.952157+00:00 app[web.1]: self.reap_workers()
2021-06-14T10:51:35.952180+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2021-06-14T10:51:35.952629+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2021-06-14T10:51:35.952784+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2021-06-14T10:51:36.054399+00:00 heroku[web.1]: Process exited with status 1
2021-06-14T10:51:36.153878+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-14T10:55:27.000000+00:00 app[api]: Build started by user myname.com
2021-06-14T10:55:50.869971+00:00 app[api]: Deploy dbdd2c5e by user myname.com
2021-06-14T10:55:50.869971+00:00 app[api]: Release v17 created by user myname#gmail.com
2021-06-14T10:55:51.193981+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-14T10:55:56.765467+00:00 heroku[web.1]: Starting process with command `gunicorn games.wsgi`
2021-06-14T10:55:59.711217+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [4] [INFO] Starting gunicorn 20.1.0
2021-06-14T10:55:59.711739+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [4] [INFO] Listening at: http://0.0.0.0:14430 (4)
2021-06-14T10:55:59.711817+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [4] [INFO] Using worker: sync
2021-06-14T10:55:59.715825+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [8] [INFO] Booting worker with pid: 8
2021-06-14T10:55:59.722359+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [8] [ERROR] Exception in worker process
2021-06-14T10:55:59.722360+00:00 app[web.1]: Traceback (most recent call last):
2021-06-14T10:55:59.722361+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-06-14T10:55:59.722361+00:00 app[web.1]: worker.init_process()
2021-06-14T10:55:59.722361+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-06-14T10:55:59.722362+00:00 app[web.1]: self.load_wsgi()
2021-06-14T10:55:59.722362+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-06-14T10:55:59.722362+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2021-06-14T10:55:59.722363+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-06-14T10:55:59.722363+00:00 app[web.1]: self.callable = self.load()
2021-06-14T10:55:59.722363+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-06-14T10:55:59.722363+00:00 app[web.1]: return self.load_wsgiapp()
2021-06-14T10:55:59.722363+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-06-14T10:55:59.722364+00:00 app[web.1]: return util.import_app(self.app_uri)
2021-06-14T10:55:59.722364+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 359, in import_app
2021-06-14T10:55:59.722364+00:00 app[web.1]: mod = importlib.import_module(module)
2021-06-14T10:55:59.722364+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2021-06-14T10:55:59.722365+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-14T10:55:59.722365+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2021-06-14T10:55:59.722365+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2021-06-14T10:55:59.722365+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
2021-06-14T10:55:59.722366+00:00 app[web.1]: ModuleNotFoundError: No module named 'games.wsgi'
2021-06-14T10:55:59.722473+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [8] [INFO] Worker exiting (pid: 8)
2021-06-14T10:55:59.738771+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [9] [INFO] Booting worker with pid: 9
2021-06-14T10:55:59.746563+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [9] [ERROR] Exception in worker process
2021-06-14T10:55:59.746564+00:00 app[web.1]: Traceback (most recent call last):
2021-06-14T10:55:59.746565+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-06-14T10:55:59.746565+00:00 app[web.1]: worker.init_process()
2021-06-14T10:55:59.746565+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-06-14T10:55:59.746566+00:00 app[web.1]: self.load_wsgi()
2021-06-14T10:55:59.746566+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-06-14T10:55:59.746566+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2021-06-14T10:55:59.746567+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-06-14T10:55:59.746567+00:00 app[web.1]: self.callable = self.load()
2021-06-14T10:55:59.746567+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-06-14T10:55:59.746568+00:00 app[web.1]: return self.load_wsgiapp()
2021-06-14T10:55:59.746568+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-06-14T10:55:59.746568+00:00 app[web.1]: return util.import_app(self.app_uri)
2021-06-14T10:55:59.746568+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 359, in import_app
2021-06-14T10:55:59.746568+00:00 app[web.1]: mod = importlib.import_module(module)
2021-06-14T10:55:59.746569+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2021-06-14T10:55:59.746569+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-14T10:55:59.746569+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2021-06-14T10:55:59.746569+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2021-06-14T10:55:59.746570+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
2021-06-14T10:55:59.746570+00:00 app[web.1]: ModuleNotFoundError: No module named 'games.wsgi'
2021-06-14T10:55:59.746797+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [9] [INFO] Worker exiting (pid: 9)
2021-06-14T10:55:59.769510+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [4] [WARNING] Worker with pid 9 was terminated due to signal 15
2021-06-14T10:55:59.868197+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [4] [INFO] Shutting down: Master
2021-06-14T10:55:59.868318+00:00 app[web.1]: [2021-06-14 10:55:59 +0000] [4] [INFO] Reason: Worker failed to boot.
2021-06-14T10:55:59.935108+00:00 heroku[web.1]: Process exited with status 3
2021-06-14T10:56:00.034150+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-14T10:56:01.000000+00:00 app[api]: Build succeeded
2021-06-14T10:56:14.181661+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gameportaladitya.herokuapp.com request_id=3c6f34d2-b6cd-4d58-a6b2-985e495daf0f fwd="122.177.148.42" dyno= connect= service= status=503 bytes= protocol=https
2021-06-14T10:56:15.394506+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gameportaladitya.herokuapp.com request_id=5693205c-1af0-4846-be22-cf96d5306131 fwd="122.177.148.42" dyno= connect= service= status=503 bytes= protocol=https
2021-06-14T10:56:34.499111+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gameportaladitya.herokuapp.com request_id=b3f8aa4e-b89f-4112-8330-fe52851ff034 fwd="122.177.148.42" dyno= connect= service= status=503 bytes= protocol=https
2021-06-14T10:56:36.300878+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gameportaladitya.herokuapp.com request_id=5b31ffe7-48a2-4751-a388-a526447b1179 fwd="122.177.148.42" dyno= connect= service= status=503 bytes= protocol=https
My directory structure is
D:.
│ .gitignore
│ Pipfile
│ Pipfile.lock
│ Procfile
│ requirements.txt
│
│
└───games
│ db.sqlite3
│ manage.py
│
├───games
│ asgi.py
│ settings.py
│ urls.py
│ wsgi.py
│ __init__.py
│
├───my_games
│ │ admin.py
│ │ apps.py
│ │ models.py
│ │ tests.py
│ │ views.py
│ │ __init__.py
│ │
│ └───migrations
│ 0001_initial.py
│ __init__.py
│
├───static
Can someone help I have been trying to figure out but everything seems to be correct but still I'm getting this error
Probably it's about Python path.
Had the same problem on Centos8.
Simply changed PYTHONPATH to the directory wsgi.py is in.
In case of Linux it would be export PYTHONPATH='D/games/games'.
If you use IDE, you can manage PYTHONPATH from IDE settings.
Then step one level upper to 'D/games' and then try
gunicorn games.wsgi:application.
idk how to change pythonath on Windows but seems this article is all about it:
How to add to the PYTHONPATH in Windows, so it finds my modules/packages?

heroku app successfully deployed but showing application error

heroku logs --tail --app fooodie-bot2021
» Warning: heroku update available from 7.53.0 to 7.54.0.
2021-06-04T18:44:13.667090+00:00 heroku[web.1]: Starting process with command `gunicorn --bind 0.0.0.0:58344 app:app`
2021-06-04T18:44:17.360140+00:00 app[web.1]: [2021-06-04 18:44:17 +0000] [4] [INFO] Starting gunicorn 20.1.0
2021-06-04T18:44:17.360928+00:00 app[web.1]: [2021-06-04 18:44:17 +0000] [4] [INFO] Listening at: http://0.0.0.0:58344 (4)
2021-06-04T18:44:17.361067+00:00 app[web.1]: [2021-06-04 18:44:17 +0000] [4] [INFO] Using worker: sync
2021-06-04T18:44:17.367156+00:00 app[web.1]: [2021-06-04 18:44:17 +0000] [7] [INFO] Booting worker with pid: 7
2021-06-04T18:44:17.375131+00:00 app[web.1]: [2021-06-04 18:44:17 +0000] [7] [ERROR] Exception in worker process
2021-06-04T18:44:17.375145+00:00 app[web.1]: Traceback (most recent call last):
2021-06-04T18:44:17.375147+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-06-04T18:44:17.375148+00:00 app[web.1]: worker.init_process()
2021-06-04T18:44:17.375149+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-06-04T18:44:17.375149+00:00 app[web.1]: self.load_wsgi()
2021-06-04T18:44:17.375149+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-06-04T18:44:17.375150+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2021-06-04T18:44:17.375151+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-06-04T18:44:17.375152+00:00 app[web.1]: self.callable = self.load()
2021-06-04T18:44:17.375152+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-06-04T18:44:17.375152+00:00 app[web.1]: return self.load_wsgiapp()
2021-06-04T18:44:17.375153+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-06-04T18:44:17.375153+00:00 app[web.1]: return util.import_app(self.app_uri)
2021-06-04T18:44:17.375154+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
2021-06-04T18:44:17.375154+00:00 app[web.1]: mod = importlib.import_module(module)
2021-06-04T18:44:17.375154+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-06-04T18:44:17.375155+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-04T18:44:17.375155+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-06-04T18:44:17.375156+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-06-04T18:44:17.375156+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
2021-06-04T18:44:17.375156+00:00 app[web.1]: ModuleNotFoundError: No module named 'app'
2021-06-04T18:44:17.375384+00:00 app[web.1]: [2021-06-04 18:44:17 +0000] [7] [INFO] Worker exiting (pid: 7)
2021-06-04T18:44:17.435219+00:00 app[web.1]: [2021-06-04 18:44:17 +0000] [4] [INFO] Shutting down: Master
2021-06-04T18:44:17.435220+00:00 app[web.1]: [2021-06-04 18:44:17 +0000] [4] [INFO] Reason: Worker failed to boot.
2021-06-04T18:44:17.529984+00:00 heroku[web.1]: Process exited with status 3
2021-06-04T18:44:17.603954+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-04T20:52:46.691043+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-04T20:52:53.880135+00:00 heroku[web.1]: Starting process with command `gunicorn --bind 0.0.0.0:32290 app:app`
2021-06-04T20:52:57.015064+00:00 app[web.1]: [2021-06-04 20:52:57 +0000] [4] [INFO] Starting gunicorn 20.1.0
2021-06-04T20:52:57.015457+00:00 app[web.1]: [2021-06-04 20:52:57 +0000] [4] [INFO] Listening at: http://0.0.0.0:32290 (4)
2021-06-04T20:52:57.015537+00:00 app[web.1]: [2021-06-04 20:52:57 +0000] [4] [INFO] Using worker: sync
2021-06-04T20:52:57.019297+00:00 app[web.1]: [2021-06-04 20:52:57 +0000] [7] [INFO] Booting worker with pid: 7
2021-06-04T20:52:57.025214+00:00 app[web.1]: [2021-06-04 20:52:57 +0000] [7] [ERROR] Exception in worker process
2021-06-04T20:52:57.025215+00:00 app[web.1]: Traceback (most recent call last):
2021-06-04T20:52:57.025216+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-06-04T20:52:57.025216+00:00 app[web.1]: worker.init_process()
2021-06-04T20:52:57.025217+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-06-04T20:52:57.025217+00:00 app[web.1]: self.load_wsgi()
2021-06-04T20:52:57.025217+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-06-04T20:52:57.025218+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2021-06-04T20:52:57.025218+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-06-04T20:52:57.025219+00:00 app[web.1]: self.callable = self.load()
2021-06-04T20:52:57.025219+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-06-04T20:52:57.025219+00:00 app[web.1]: return self.load_wsgiapp()
2021-06-04T20:52:57.025220+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-06-04T20:52:57.025220+00:00 app[web.1]: return util.import_app(self.app_uri)
2021-06-04T20:52:57.025220+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
2021-06-04T20:52:57.025221+00:00 app[web.1]: mod = importlib.import_module(module)
2021-06-04T20:52:57.025221+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-06-04T20:52:57.025222+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-04T20:52:57.025222+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-06-04T20:52:57.025222+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-06-04T20:52:57.025223+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
2021-06-04T20:52:57.025223+00:00 app[web.1]: ModuleNotFoundError: No module named 'app'
2021-06-04T20:52:57.025357+00:00 app[web.1]: [2021-06-04 20:52:57 +0000] [7] [INFO] Worker exiting (pid: 7)
2021-06-04T20:52:57.060273+00:00 app[web.1]: [2021-06-04 20:52:57 +0000] [4] [INFO] Shutting down: Master
2021-06-04T20:52:57.060339+00:00 app[web.1]: [2021-06-04 20:52:57 +0000] [4] [INFO] Reason: Worker failed to boot.
2021-06-04T20:52:57.136841+00:00 heroku[web.1]: Process exited with status 3
2021-06-04T20:52:57.214462+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-04T23:56:33.244581+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-04T23:56:41.153062+00:00 heroku[web.1]: Starting process with command `gunicorn --bind 0.0.0.0:44202 app:app`
2021-06-04T23:56:45.069131+00:00 app[web.1]: [2021-06-04 23:56:45 +0000] [4] [INFO] Starting gunicorn 20.1.0
2021-06-04T23:56:45.069673+00:00 app[web.1]: [2021-06-04 23:56:45 +0000] [4] [INFO] Listening at: http://0.0.0.0:44202 (4)
2021-06-04T23:56:45.069777+00:00 app[web.1]: [2021-06-04 23:56:45 +0000] [4] [INFO] Using worker: sync
2021-06-04T23:56:45.073690+00:00 app[web.1]: [2021-06-04 23:56:45 +0000] [7] [INFO] Booting worker with pid: 7
2021-06-04T23:56:45.078553+00:00 app[web.1]: [2021-06-04 23:56:45 +0000] [7] [ERROR] Exception in worker process
2021-06-04T23:56:45.078582+00:00 app[web.1]: Traceback (most recent call last):
2021-06-04T23:56:45.078588+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-06-04T23:56:45.078594+00:00 app[web.1]: worker.init_process()
2021-06-04T23:56:45.078594+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-06-04T23:56:45.078595+00:00 app[web.1]: self.load_wsgi()
2021-06-04T23:56:45.078595+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-06-04T23:56:45.078595+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2021-06-04T23:56:45.078600+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-06-04T23:56:45.078601+00:00 app[web.1]: self.callable = self.load()
2021-06-04T23:56:45.078601+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-06-04T23:56:45.078601+00:00 app[web.1]: return self.load_wsgiapp()
2021-06-04T23:56:45.078602+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-06-04T23:56:45.078602+00:00 app[web.1]: return util.import_app(self.app_uri)
2021-06-04T23:56:45.078602+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
2021-06-04T23:56:45.078603+00:00 app[web.1]: mod = importlib.import_module(module)
2021-06-04T23:56:45.078603+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/__init__.py", line 127, in import_module
2021-06-04T23:56:45.078604+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-06-04T23:56:45.078604+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2021-06-04T23:56:45.078605+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2021-06-04T23:56:45.078605+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
2021-06-04T23:56:45.078605+00:00 app[web.1]: ModuleNotFoundError: No module named 'app'
2021-06-04T23:56:45.078700+00:00 app[web.1]: [2021-06-04 23:56:45 +0000] [7] [INFO] Worker exiting (pid: 7)
2021-06-04T23:56:45.117467+00:00 app[web.1]: [2021-06-04 23:56:45 +0000] [4] [INFO] Shutting down: Master
2021-06-04T23:56:45.117651+00:00 app[web.1]: [2021-06-04 23:56:45 +0000] [4] [INFO] Reason: Worker failed to boot.
2021-06-04T23:56:45.231963+00:00 heroku[web.1]: Process exited with status 3
2021-06-04T23:56:45.388008+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-05T03:47:07.088448+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fooodie-bot2021.herokuapp.com request_id=aa2aa16a-bb5f-44d6-a6ea-4083e463693f fwd="42.106.107.86" dyno= connect= service= status=503 bytes= protocol=https
2021-06-05T03:47:07.663226+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fooodie-bot2021.herokuapp.com request_id=4e065a27-291a-4498-b690-f70f0df250cc fwd="42.106.107.86" dyno= connect= service= status=503 bytes= protocol=https
Error says there is no module named app, please check if your python file is named app and has Flask instance equal to app.

ModuleNotFoundError: No module named 'mysite.wsgi' error comes up during deployment

I was making a Django web app using pipenv, the Application error window pops up whenever i try running 'heroku open', please help i am stuck in deploying this for over one month and have tried almost every possible solution that was available online but the error still persists. please help.
Running'heroku logs --tail' shows:
$ heroku logs --tail
2021-02-17T17:50:51.188410+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2021-02-17T17:50:51.297606+00:00 heroku[web.1]: Process exited with status 1
2021-02-17T17:50:51.389796+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-17T17:50:53.000000+00:00 app[api]: Build succeeded
2021-02-17T17:51:39.619675+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=bloggero.herokuapp.com request_id=ecbd78a2-5542-4d08-87f7-e7d12404ae9b fwd="223.239.61.176" dyno= connect= service= status=503 bytes= protocol=https
2021-02-17T17:51:41.855171+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=bloggero.herokuapp.com request_id=42dd37d3-ad4b-43dc-956d-41d34bf03ffd fwd="223.239.61.176" dyno= connect= service= status=503 bytes= protocol=https
2021-02-17T18:04:58.000000+00:00 app[api]: Build started by user ad******#gmail.com
2021-02-17T18:05:29.716771+00:00 app[api]: Deploy 879be0de by user a******#gmail.com
2021-02-17T18:05:29.716771+00:00 app[api]: Release v19 created by user a*******#gmail.com
2021-02-17T18:05:30.074089+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-17T18:05:35.396728+00:00 heroku[web.1]: Starting process with command `gunicorn mysite.wsgi`
2021-02-17T18:05:37.756029+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [4] [INFO] Starting gunicorn 20.0.4
2021-02-17T18:05:37.756584+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [4] [INFO] Listening at: http://0.0.0.0:17786 (4)
2021-02-17T18:05:37.756675+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [4] [INFO] Using worker: sync
2021-02-17T18:05:37.761624+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [9] [INFO] Booting worker with pid: 9
2021-02-17T18:05:37.770211+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [9] [ERROR] Exception in worker process
2021-02-17T18:05:37.770213+00:00 app[web.1]: Traceback (most recent call last):
2021-02-17T18:05:37.770232+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2021-02-17T18:05:37.770233+00:00 app[web.1]: worker.init_process()
2021-02-17T18:05:37.770234+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
2021-02-17T18:05:37.770234+00:00 app[web.1]: self.load_wsgi()
2021-02-17T18:05:37.770234+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2021-02-17T18:05:37.770235+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2021-02-17T18:05:37.770235+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-02-17T18:05:37.770236+00:00 app[web.1]: self.callable = self.load()
2021-02-17T18:05:37.770236+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2021-02-17T18:05:37.770236+00:00 app[web.1]: return self.load_wsgiapp()
2021-02-17T18:05:37.770237+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2021-02-17T18:05:37.770237+00:00 app[web.1]: return util.import_app(self.app_uri)
2021-02-17T18:05:37.770238+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
2021-02-17T18:05:37.770238+00:00 app[web.1]: mod = importlib.import_module(module)
2021-02-17T18:05:37.770238+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/importlib/__init__.py", line 127, in import_module
2021-02-17T18:05:37.770239+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-02-17T18:05:37.770239+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2021-02-17T18:05:37.770240+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2021-02-17T18:05:37.770240+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
2021-02-17T18:05:37.770240+00:00 app[web.1]: ModuleNotFoundError: No module named 'mysite.wsgi'
2021-02-17T18:05:37.770465+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [9] [INFO] Worker exiting (pid: 9)
2021-02-17T18:05:37.779801+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [10] [INFO] Booting worker with pid: 10
2021-02-17T18:05:37.785931+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [10] [ERROR] Exception in worker process
2021-02-17T18:05:37.785933+00:00 app[web.1]: Traceback (most recent call last):
2021-02-17T18:05:37.785934+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2021-02-17T18:05:37.785934+00:00 app[web.1]: worker.init_process()
2021-02-17T18:05:37.785934+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
2021-02-17T18:05:37.785935+00:00 app[web.1]: self.load_wsgi()
2021-02-17T18:05:37.785935+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2021-02-17T18:05:37.785936+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2021-02-17T18:05:37.785937+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-02-17T18:05:37.785937+00:00 app[web.1]: self.callable = self.load()
2021-02-17T18:05:37.785937+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2021-02-17T18:05:37.785938+00:00 app[web.1]: return self.load_wsgiapp()
2021-02-17T18:05:37.785938+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2021-02-17T18:05:37.785939+00:00 app[web.1]: return util.import_app(self.app_uri)
2021-02-17T18:05:37.785939+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
2021-02-17T18:05:37.785939+00:00 app[web.1]: mod = importlib.import_module(module)
2021-02-17T18:05:37.785940+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/importlib/__init__.py", line 127, in import_module
2021-02-17T18:05:37.785940+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-02-17T18:05:37.785941+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2021-02-17T18:05:37.785941+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2021-02-17T18:05:37.785941+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
2021-02-17T18:05:37.785942+00:00 app[web.1]: ModuleNotFoundError: No module named 'mysite.wsgi'
2021-02-17T18:05:37.786104+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [10] [INFO] Worker exiting (pid: 10)
2021-02-17T18:05:37.906870+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [4] [INFO] Shutting down: Master
2021-02-17T18:05:37.906946+00:00 app[web.1]: [2021-02-17 18:05:37 +0000] [4] [INFO] Reason: Worker failed to boot.
2021-02-17T18:05:37.987061+00:00 heroku[web.1]: Process exited with status 3
2021-02-17T18:05:38.059333+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-17T18:05:38.062623+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-17T18:05:41.000000+00:00 app[api]: Build succeeded
2021-02-17T18:05:48.981104+00:00 heroku[web.1]: Starting process with command `gunicorn mysite.wsgi`
2021-02-17T18:05:52.073363+00:00 app[web.1]: [2021-02-17 18:05:52 +0000] [4] [INFO] Starting gunicorn 20.0.4
2021-02-17T18:05:52.074407+00:00 app[web.1]: [2021-02-17 18:05:52 +0000] [4] [INFO] Listening at: http://0.0.0.0:45799 (4)
2021-02-17T18:05:52.074661+00:00 app[web.1]: [2021-02-17 18:05:52 +0000] [4] [INFO] Using worker: sync
2021-02-17T18:05:52.082772+00:00 app[web.1]: [2021-02-17 18:05:52 +0000] [9] [INFO] Booting worker with pid: 9
2021-02-17T18:05:52.096292+00:00 app[web.1]: [2021-02-17 18:05:52 +0000] [9] [ERROR] Exception in worker process
2021-02-17T18:05:52.096293+00:00 app[web.1]: Traceback (most recent call last):
2021-02-17T18:05:52.096302+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2021-02-17T18:05:52.096303+00:00 app[web.1]: worker.init_process()
2021-02-17T18:05:52.096303+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
2021-02-17T18:05:52.096303+00:00 app[web.1]: self.load_wsgi()
2021-02-17T18:05:52.096304+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2021-02-17T18:05:52.096304+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2021-02-17T18:05:52.096304+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-02-17T18:05:52.096305+00:00 app[web.1]: self.callable = self.load()
2021-02-17T18:05:52.096305+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2021-02-17T18:05:52.096306+00:00 app[web.1]: return self.load_wsgiapp()
2021-02-17T18:05:52.096306+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2021-02-17T18:05:52.096306+00:00 app[web.1]: return util.import_app(self.app_uri)
2021-02-17T18:05:52.096307+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
2021-02-17T18:05:52.096307+00:00 app[web.1]: mod = importlib.import_module(module)
2021-02-17T18:05:52.096307+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/importlib/__init__.py", line 127, in import_module
2021-02-17T18:05:52.096308+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2021-02-17T18:05:52.096308+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2021-02-17T18:05:52.096309+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2021-02-17T18:05:52.096309+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
2021-02-17T18:05:52.096310+00:00 app[web.1]: ModuleNotFoundError: No module named 'mysite.wsgi'
2021-02-17T18:05:52.096657+00:00 app[web.1]: [2021-02-17 18:05:52 +0000] [9] [INFO] Worker exiting (pid: 9)
2021-02-17T18:05:52.131656+00:00 app[web.1]: [2021-02-17 18:05:52 +0000] [4] [INFO] Shutting down: Master
2021-02-17T18:05:52.131783+00:00 app[web.1]: [2021-02-17 18:05:52 +0000] [4] [INFO] Reason: Worker failed to boot.
2021-02-17T18:05:52.238783+00:00 heroku[web.1]: Process exited with status 3
2021-02-17T18:05:52.335630+00:00 heroku[web.1]: State changed from starting to crashed
I checked the Procfile and it looks :
web: gunicorn mysite.wsgi
And here is the wsgi.py module:
from helloworld.wsgi import HelloWorldApplication
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
application = get_wsgi_application()
application = HelloWorldApplication(application)
The project structure is as follows-
And i have already installed gunicorn and other requirements which can be seen here in the pipfile:-
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
asgiref = "==3.2.10"
django-crispy-forms = "==1.10.0"
pytz = "==2020.4"
sqlparse = "==0.4.1"
Django = "==3.1"
Pillow = "==8.0.1"
gunicorn = "*"
[requires]
python_version = "3.7"
From a quick google search I found another thread with a similar question. The answers seem to indicate that you need to add your project directory in your python path.
First, import the sys module.
import sys
Now, right before the os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') line, add:
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if path not in sys.path:
sys.path.append(path)
This code snippet grabs the absolute path to your project directory and appends it to your python path if it is not already there.
Also, I second Field Boy's response that you should consider a linux server.
Please don't waste your time with heroku, you will always run into problems, even after your app started fine, if your app is fairly large. Use a virtual machine (check digital ocean or linode they have free $100 credit) and your app will run just like on your laptop. Look for Corey Schafer Django deployment on linux server on youtube on how to set up Apache2 virtual server on the linux server.

Application error - When I uploading my Django app on Heroku

Uploading my Django app on Heroku
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
heroku logs:
$ heroku logs -n 150
(node:19036) SyntaxError Plugin: heroku: C:\Users\Meteor\AppData\Local\heroku\version: Unexpected token in JSON at position 0
module: #oclif/config#1.13.2
task: runHook init
plugin: heroku
root: C:\Program Files\heroku\client
See more details with DEBUG=*
(node:19036) SyntaxError Plugin: heroku: C:\Users\Meteor\AppData\Local\heroku\config.json: Unexpected token in JSON at position 0
module: #oclif/config#1.13.2
task: runHook prerun
plugin: heroku
root: C:\Program Files\heroku\client
See more details with DEBUG=*
2020-11-05T15:09:42.984311+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-11-05T15:09:42.984311+00:00 app[web.1]: self.callable = self.load()
2020-11-05T15:09:42.984312+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2020-11-05T15:09:42.984312+00:00 app[web.1]: return self.load_wsgiapp()
2020-11-05T15:09:42.984312+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2020-11-05T15:09:42.984313+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-11-05T15:09:42.984313+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 350, in import_app
2020-11-05T15:09:42.984314+00:00 app[web.1]: __import__(module)
2020-11-05T15:09:42.984314+00:00 app[web.1]: File "/app/newspaper_project/wsgi.py", line 12, in <module>
2020-11-05T15:09:42.984315+00:00 app[web.1]: from django.core.wsgi import get_wsgi_application
2020-11-05T15:09:42.984315+00:00 app[web.1]: ModuleNotFoundError: No module named 'django'
2020-11-05T15:09:42.984555+00:00 app[web.1]: [2020-11-05 15:09:42 +0000] [9] [INFO] Worker exiting (pid: 9)
2020-11-05T15:09:42.992599+00:00 app[web.1]: [2020-11-05 15:09:42 +0000] [10] [INFO] Booting worker with pid: 10
2020-11-05T15:09:43.000000+00:00 app[api]: Build succeeded
2020-11-05T15:09:43.001925+00:00 app[web.1]: [2020-11-05 15:09:42 +0000] [10] [ERROR] Exception in worker process
2020-11-05T15:09:43.001929+00:00 app[web.1]: Traceback (most recent call last):
2020-11-05T15:09:43.001929+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-11-05T15:09:43.001930+00:00 app[web.1]: worker.init_process()
2020-11-05T15:09:43.001931+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 129, in init_process
2020-11-05T15:09:43.001931+00:00 app[web.1]: self.load_wsgi()
2020-11-05T15:09:43.001932+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2020-11-05T15:09:43.001932+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-11-05T15:09:43.001933+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-11-05T15:09:43.001933+00:00 app[web.1]: self.callable = self.load()
2020-11-05T15:09:43.001934+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2020-11-05T15:09:43.001934+00:00 app[web.1]: return self.load_wsgiapp()
2020-11-05T15:09:43.001935+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2020-11-05T15:09:43.001935+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-11-05T15:09:43.001936+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 350, in import_app
2020-11-05T15:09:43.001936+00:00 app[web.1]: __import__(module)
2020-11-05T15:09:43.001936+00:00 app[web.1]: File "/app/newspaper_project/wsgi.py", line 12, in <module>
2020-11-05T15:09:43.001937+00:00 app[web.1]: from django.core.wsgi import get_wsgi_application
2020-11-05T15:09:43.001937+00:00 app[web.1]: ModuleNotFoundError: No module named 'django'
2020-11-05T15:09:43.002169+00:00 app[web.1]: [2020-11-05 15:09:43 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-11-05T15:09:43.149710+00:00 app[web.1]: [2020-11-05 15:09:43 +0000] [4] [INFO] Shutting down: Master
2020-11-05T15:09:43.149823+00:00 app[web.1]: [2020-11-05 15:09:43 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-11-05T15:09:43.250459+00:00 heroku[web.1]: Process exited with status 3
2020-11-05T15:09:43.303365+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-05T15:09:43.306915+00:00 heroku[web.1]: State changed from crashed to starting
2020-11-05T15:09:49.074113+00:00 heroku[web.1]: Starting process with command `gunicorn newspaper_project.wsgi`
2020-11-05T15:09:51.509525+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [4] [INFO] Starting gunicorn 19.9.0
2020-11-05T15:09:51.510059+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [4] [INFO] Listening at: http://0.0.0.0:24987 (4)
2020-11-05T15:09:51.510167+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [4] [INFO] Using worker: sync
2020-11-05T15:09:51.511620+00:00 app[web.1]: /app/.heroku/python/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
2020-11-05T15:09:51.511621+00:00 app[web.1]: return io.open(fd, *args, **kwargs)
2020-11-05T15:09:51.515120+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [9] [INFO] Booting worker with pid: 9
2020-11-05T15:09:51.524599+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [9] [ERROR] Exception in worker process
2020-11-05T15:09:51.524600+00:00 app[web.1]: Traceback (most recent call last):
2020-11-05T15:09:51.524601+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-11-05T15:09:51.524601+00:00 app[web.1]: worker.init_process()
2020-11-05T15:09:51.524602+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 129, in init_process
2020-11-05T15:09:51.524602+00:00 app[web.1]: self.load_wsgi()
2020-11-05T15:09:51.524603+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2020-11-05T15:09:51.524603+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-11-05T15:09:51.524604+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-11-05T15:09:51.524604+00:00 app[web.1]: self.callable = self.load()
2020-11-05T15:09:51.524605+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2020-11-05T15:09:51.524605+00:00 app[web.1]: return self.load_wsgiapp()
2020-11-05T15:09:51.524605+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2020-11-05T15:09:51.524606+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-11-05T15:09:51.524606+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 350, in import_app
2020-11-05T15:09:51.524607+00:00 app[web.1]: __import__(module)
2020-11-05T15:09:51.524607+00:00 app[web.1]: File "/app/newspaper_project/wsgi.py", line 12, in <module>
2020-11-05T15:09:51.524608+00:00 app[web.1]: from django.core.wsgi import get_wsgi_application
2020-11-05T15:09:51.524608+00:00 app[web.1]: ModuleNotFoundError: No module named 'django'
2020-11-05T15:09:51.524784+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [9] [INFO] Worker exiting (pid: 9)
2020-11-05T15:09:51.530248+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [10] [INFO] Booting worker with pid: 10
2020-11-05T15:09:51.536468+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [10] [ERROR] Exception in worker process
2020-11-05T15:09:51.536470+00:00 app[web.1]: Traceback (most recent call last):
2020-11-05T15:09:51.536471+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-11-05T15:09:51.536471+00:00 app[web.1]: worker.init_process()
2020-11-05T15:09:51.536472+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 129, in init_process
2020-11-05T15:09:51.536472+00:00 app[web.1]: self.load_wsgi()
2020-11-05T15:09:51.536472+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2020-11-05T15:09:51.536473+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-11-05T15:09:51.536473+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-11-05T15:09:51.536474+00:00 app[web.1]: self.callable = self.load()
2020-11-05T15:09:51.536474+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2020-11-05T15:09:51.536474+00:00 app[web.1]: return self.load_wsgiapp()
2020-11-05T15:09:51.536475+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2020-11-05T15:09:51.536475+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-11-05T15:09:51.536476+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 350, in import_app
2020-11-05T15:09:51.536476+00:00 app[web.1]: __import__(module)
2020-11-05T15:09:51.536476+00:00 app[web.1]: File "/app/newspaper_project/wsgi.py", line 12, in <module>
2020-11-05T15:09:51.536477+00:00 app[web.1]: from django.core.wsgi import get_wsgi_application
2020-11-05T15:09:51.536477+00:00 app[web.1]: ModuleNotFoundError: No module named 'django'
2020-11-05T15:09:51.536590+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-11-05T15:09:51.660520+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [4] [INFO] Shutting down: Master
2020-11-05T15:09:51.660654+00:00 app[web.1]: [2020-11-05 15:09:51 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-11-05T15:09:51.756274+00:00 heroku[web.1]: Process exited with status 3
2020-11-05T15:09:51.807711+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-05T15:10:24.269598+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=newspaper-2020.herokuapp.com request_id=a22f6b28-a334-420a-ade1-6f8e75560879 fwd="37.200.249.220" dyno= connect= service= status=503 bytes= protocol=https
2020-11-05T15:10:25.689071+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=newspaper-2020.herokuapp.com request_id=bf4c18e7-5264-4f33-ae49-5357c96309ce fwd="37.200.249.220" dyno= connect= service= status=503 bytes= protocol=https
2020-11-05T15:34:51.096827+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=newspaper-2020.herokuapp.com request_id=e9eb3726-4dab-4a49-ae2b-20efa66ae8c6 fwd="37.200.249.220" dyno= connect= service= status=503 bytes= protocol=https
2020-11-05T15:34:52.078404+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=newspaper-2020.herokuapp.com request_id=148807ce-b410-4528-b799-86f3aa265fb0 fwd="37.200.249.220" dyno= connect= service= status=503 bytes= protocol=https
2020-11-05T15:39:03.883280+00:00 heroku[web.1]: State changed from crashed to starting
2020-11-05T15:39:09.428963+00:00 heroku[web.1]: Starting process with command `gunicorn newspaper_project.wsgi`
2020-11-05T15:39:11.237450+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [4] [INFO] Starting gunicorn 19.9.0
2020-11-05T15:39:11.238023+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [4] [INFO] Listening at: http://0.0.0.0:20576 (4)
2020-11-05T15:39:11.238148+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [4] [INFO] Using worker: sync
2020-11-05T15:39:11.239551+00:00 app[web.1]: /app/.heroku/python/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
2020-11-05T15:39:11.239552+00:00 app[web.1]: return io.open(fd, *args, **kwargs)
2020-11-05T15:39:11.242528+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [9] [INFO] Booting worker with pid: 9
2020-11-05T15:39:11.249559+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [9] [ERROR] Exception in worker process
2020-11-05T15:39:11.249561+00:00 app[web.1]: Traceback (most recent call last):
2020-11-05T15:39:11.249561+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-11-05T15:39:11.249561+00:00 app[web.1]: worker.init_process()
2020-11-05T15:39:11.249562+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 129, in init_process
2020-11-05T15:39:11.249562+00:00 app[web.1]: self.load_wsgi()
2020-11-05T15:39:11.249562+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2020-11-05T15:39:11.249562+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-11-05T15:39:11.249563+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-11-05T15:39:11.249563+00:00 app[web.1]: self.callable = self.load()
2020-11-05T15:39:11.249563+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2020-11-05T15:39:11.249564+00:00 app[web.1]: return self.load_wsgiapp()
2020-11-05T15:39:11.249564+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2020-11-05T15:39:11.249564+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-11-05T15:39:11.249564+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 350, in import_app
2020-11-05T15:39:11.249565+00:00 app[web.1]: __import__(module)
2020-11-05T15:39:11.249565+00:00 app[web.1]: File "/app/newspaper_project/wsgi.py", line 12, in <module>
2020-11-05T15:39:11.249565+00:00 app[web.1]: from django.core.wsgi import get_wsgi_application
2020-11-05T15:39:11.249565+00:00 app[web.1]: ModuleNotFoundError: No module named 'django'
2020-11-05T15:39:11.249689+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [9] [INFO] Worker exiting (pid: 9)
2020-11-05T15:39:11.268247+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [10] [INFO] Booting worker with pid: 10
2020-11-05T15:39:11.275520+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [10] [ERROR] Exception in worker process
2020-11-05T15:39:11.275522+00:00 app[web.1]: Traceback (most recent call last):
2020-11-05T15:39:11.275522+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-11-05T15:39:11.275522+00:00 app[web.1]: worker.init_process()
2020-11-05T15:39:11.275523+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 129, in init_process
2020-11-05T15:39:11.275523+00:00 app[web.1]: self.load_wsgi()
2020-11-05T15:39:11.275523+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2020-11-05T15:39:11.275523+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-11-05T15:39:11.275524+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-11-05T15:39:11.275524+00:00 app[web.1]: self.callable = self.load()
2020-11-05T15:39:11.275524+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2020-11-05T15:39:11.275525+00:00 app[web.1]: return self.load_wsgiapp()
2020-11-05T15:39:11.275525+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2020-11-05T15:39:11.275530+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-11-05T15:39:11.275530+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 350, in import_app
2020-11-05T15:39:11.275530+00:00 app[web.1]: __import__(module)
2020-11-05T15:39:11.275530+00:00 app[web.1]: File "/app/newspaper_project/wsgi.py", line 12, in <module>
2020-11-05T15:39:11.275531+00:00 app[web.1]: from django.core.wsgi import get_wsgi_application
2020-11-05T15:39:11.275531+00:00 app[web.1]: ModuleNotFoundError: No module named 'django'
2020-11-05T15:39:11.275653+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-11-05T15:39:11.379193+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [4] [INFO] Shutting down: Master
2020-11-05T15:39:11.379278+00:00 app[web.1]: [2020-11-05 15:39:11 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-11-05T15:39:11.435045+00:00 heroku[web.1]: Process exited with status 3
2020-11-05T15:39:11.484782+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-05T16:38:31.058784+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=newspaper-2020.herokuapp.com request_id=a1ab1357-b3d9-4f51-81b8-4bbacd42eebd fwd="37.200.249.220" dyno= connect= service= status=503 bytes= protocol=https
2020-11-05T16:38:32.907711+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=newspaper-2020.herokuapp.com request_id=3bda3bf8-d10f-496a-a228-a35286e148e0 fwd="37.200.249.220" dyno= connect= service= status=503 bytes= protocol=https

Django Heroku no module named 'my app name'

I'm trying to deploy my first Django app to Heroku. I was able to migrate the database and create a superuser, but now I'm stuck on this:
[2018-05-19 22:51:01 +0000] [4] [INFO] Listening at: http://0.0.0.0:31247 (4)
2018-05-19T22:51:01.283512+00:00 app[web.1]: [2018-05-19 22:51:01 +0000] [4] [INFO] Using worker: sync
2018-05-19T22:51:01.287214+00:00 app[web.1]: [2018-05-19 22:51:01 +0000] [8] [INFO] Booting worker with pid: 8
2018-05-19T22:51:01.292792+00:00 app[web.1]: [2018-05-19 22:51:01 +0000] [8] [ERROR] Exception in worker process
2018-05-19T22:51:01.292795+00:00 app[web.1]: Traceback (most recent call last):
2018-05-19T22:51:01.292796+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2018-05-19T22:51:01.292797+00:00 app[web.1]: worker.init_process()
2018-05-19T22:51:01.292798+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process
2018-05-19T22:51:01.292800+00:00 app[web.1]: self.load_wsgi()
2018-05-19T22:51:01.292801+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2018-05-19T22:51:01.292802+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2018-05-19T22:51:01.292803+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2018-05-19T22:51:01.292804+00:00 app[web.1]: self.callable = self.load()
2018-05-19T22:51:01.292806+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2018-05-19T22:51:01.292807+00:00 app[web.1]: return self.load_wsgiapp()
2018-05-19T22:51:01.292808+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2018-05-19T22:51:01.292809+00:00 app[web.1]: return util.import_app(self.app_uri)
2018-05-19T22:51:01.292810+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
2018-05-19T22:51:01.292811+00:00 app[web.1]: __import__(module)
2018-05-19T22:51:01.292816+00:00 app[web.1]: ModuleNotFoundError: No module named 'whispering-shelf-25150'
2018-05-19T22:51:01.292905+00:00 app[web.1]: [2018-05-19 22:51:01 +0000] [8] [INFO] Worker exiting (pid: 8)
2018-05-19T22:51:01.329968+00:00 app[web.1]: [2018-05-19 22:51:01 +0000] [4] [INFO] Shutting down: Master
2018-05-19T22:51:01.330127+00:00 app[web.1]: [2018-05-19 22:51:01 +0000] [4] [INFO] Reason: Worker failed to boot.
2018-05-19T22:51:01.413026+00:00 heroku[web.1]: Process exited with status 3
2018-05-19T22:51:07.070132+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=whispering-shelf-25150.herokuapp.com request_id=4b10d0f1-939f-44b6-8ee0-b535cb07f8de fwd="185.5.121.201" dyno= connect= service= status=503 bytes= protocol=https
I developed my application using some tutorials that use mysite in my settings. But now my Heroku app is named whispering-shelf-25150.
What is the relation between those names? For example, should I change every occurence of mysite in settings.py to whispering-shelf-25150?
In my wsgi file I have:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "whispering-shelf-25150.settings.settings")
What is the relation between those names? For example, should I change every occurence of mysite in settings.py to whispering-shelf-25150?
The name of your Heroku app is irrelevant. There is no relationship between it and your Python module names.
The name of your settings module must match what's in your project folder, and the name of the top-level folder doesn't matter.
For example, if your directory tree looks like
project/ ← ignore this
mysite/ ← include this
settings.py ← include this
some_app/
...
your settings module is mysite.settings.