-1
import cloudinary_storage
import os
import ssl
import certifi
import dj_database_url

Anytime I try to deploy to Heroku, it deploys successfully, but the page says application error and cloudinary module not found. I use VSCode, and the import cloudinary_storage greys out, and I have done everything U could do but it is still not working, same it true for import cloudinary.

I have set my CLOUDINARY_STORAGE and DEFAULT_FILE_STORAGE also.

I uninstalled and also installed cloudinary, and included it in the requirements.txt, but the but the same problem occurred.

I get this:

% heroku logs --tail 2024-07-10T13:21:50.045251+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.045251+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application 2024-07-10T13:21:50.045251+00:00 app[web.1]: django.setup(set_prefix=False) 2024-07-10T13:21:50.045251+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/init.py", line 19, in setup 2024-07-10T13:21:50.045252+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) 2024-07-10T13:21:50.045252+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.045252+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/conf/init.py", line 89, in getattr 2024-07-10T13:21:50.045252+00:00 app[web.1]: self._setup(name) 2024-07-10T13:21:50.045253+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/conf/init.py", line 76, in _setup 2024-07-10T13:21:50.045253+00:00 app[web.1]: self._wrapped = Settings(settings_module) 2024-07-10T13:21:50.045253+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.045255+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/conf/init.py", line 190, in init 2024-07-10T13:21:50.045256+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE) 2024-07-10T13:21:50.045256+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.045256+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/importlib/init.py", line 90, in import_module 2024-07-10T13:21:50.045256+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level) 2024-07-10T13:21:50.045257+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.045257+00:00 app[web.1]: File "", line 1387, in _gcd_import 2024-07-10T13:21:50.045257+00:00 app[web.1]: File "", line 1360, in _find_and_load 2024-07-10T13:21:50.045257+00:00 app[web.1]: File "", line 1331, in _find_and_load_unlocked 2024-07-10T13:21:50.045257+00:00 app[web.1]: File "", line 935, in _load_unlocked 2024-07-10T13:21:50.045258+00:00 app[web.1]: File "", line 995, in exec_module 2024-07-10T13:21:50.045258+00:00 app[web.1]: File "", line 488, in _call_with_frames_removed 2024-07-10T13:21:50.045258+00:00 app[web.1]: File "/app/newspaper_project/settings.py", line 14, in 2024-07-10T13:21:50.045258+00:00 app[web.1]: import cloudinary_storage 2024-07-10T13:21:50.045258+00:00 app[web.1]: ModuleNotFoundError: No module named 'cloudinary_storage' 2024-07-10T13:21:50.045334+00:00 app[web.1]: [2024-07-10 13:21:50 +0000] [9] [INFO] Worker exiting (pid: 9) 2024-07-10T13:21:50.061449+00:00 app[web.1]: [2024-07-10 13:21:50 +0000] [10] [ERROR] Exception in worker process 2024-07-10T13:21:50.061450+00:00 app[web.1]: Traceback (most recent call last): 2024-07-10T13:21:50.061451+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker 2024-07-10T13:21:50.061451+00:00 app[web.1]: worker.init_process() 2024-07-10T13:21:50.061452+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/gunicorn/workers/base.py", line 134, in init_process 2024-07-10T13:21:50.061452+00:00 app[web.1]: self.load_wsgi() 2024-07-10T13:21:50.061452+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi 2024-07-10T13:21:50.061452+00:00 app[web.1]: self.wsgi = self.app.wsgi() 2024-07-10T13:21:50.061453+00:00 app[web.1]: ^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061453+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/gunicorn/app/base.py", line 67, in wsgi 2024-07-10T13:21:50.061453+00:00 app[web.1]: self.callable = self.load() 2024-07-10T13:21:50.061453+00:00 app[web.1]: ^^^^^^^^^^^ 2024-07-10T13:21:50.061454+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 58, in load 2024-07-10T13:21:50.061454+00:00 app[web.1]: return self.load_wsgiapp() 2024-07-10T13:21:50.061454+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061454+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp 2024-07-10T13:21:50.061454+00:00 app[web.1]: return util.import_app(self.app_uri) 2024-07-10T13:21:50.061455+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061455+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/gunicorn/util.py", line 371, in import_app 2024-07-10T13:21:50.061455+00:00 app[web.1]: mod = importlib.import_module(module) 2024-07-10T13:21:50.061455+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061456+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/importlib/init.py", line 90, in import_module 2024-07-10T13:21:50.061456+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level) 2024-07-10T13:21:50.061456+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061457+00:00 app[web.1]: File "", line 1387, in _gcd_import 2024-07-10T13:21:50.061457+00:00 app[web.1]: File "", line 1360, in _find_and_load 2024-07-10T13:21:50.061457+00:00 app[web.1]: File "", line 1331, in _find_and_load_unlocked 2024-07-10T13:21:50.061461+00:00 app[web.1]: File "", line 935, in _load_unlocked 2024-07-10T13:21:50.061461+00:00 app[web.1]: File "", line 995, in exec_module 2024-07-10T13:21:50.061461+00:00 app[web.1]: File "", line 488, in _call_with_frames_removed 2024-07-10T13:21:50.061461+00:00 app[web.1]: File "/app/newspaper_project/wsgi.py", line 16, in 2024-07-10T13:21:50.061462+00:00 app[web.1]: application = get_wsgi_application() 2024-07-10T13:21:50.061462+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061462+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application 2024-07-10T13:21:50.061462+00:00 app[web.1]: django.setup(set_prefix=False) 2024-07-10T13:21:50.061463+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/init.py", line 19, in setup 2024-07-10T13:21:50.061463+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) 2024-07-10T13:21:50.061463+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061463+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/conf/init.py", line 89, in getattr 2024-07-10T13:21:50.061463+00:00 app[web.1]: self._setup(name) 2024-07-10T13:21:50.061463+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/conf/init.py", line 76, in _setup 2024-07-10T13:21:50.061464+00:00 app[web.1]: self._wrapped = Settings(settings_module) 2024-07-10T13:21:50.061464+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061464+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/django/conf/init.py", line 190, in init 2024-07-10T13:21:50.061464+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE) 2024-07-10T13:21:50.061464+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061464+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/importlib/init.py", line 90, in import_module 2024-07-10T13:21:50.061465+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level) 2024-07-10T13:21:50.061465+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-07-10T13:21:50.061465+00:00 app[web.1]: File "", line 1387, in _gcd_import 2024-07-10T13:21:50.061465+00:00 app[web.1]: File "", line 1360, in _find_and_load 2024-07-10T13:21:50.061465+00:00 app[web.1]: File "", line 1331, in _find_and_load_unlocked 2024-07-10T13:21:50.061466+00:00 app[web.1]: File "", line 935, in _load_unlocked 2024-07-10T13:21:50.061466+00:00 app[web.1]: File "", line 995, in exec_module 2024-07-10T13:21:50.061466+00:00 app[web.1]: File "", line 488, in _call_with_frames_removed 2024-07-10T13:21:50.061466+00:00 app[web.1]: File "/app/newspaper_project/settings.py", line 14, in 2024-07-10T13:21:50.061466+00:00 app[web.1]: import cloudinary_storage 2024-07-10T13:21:50.061466+00:00 app[web.1]: ModuleNotFoundError: No module named 'cloudinary_storage' 2024-07-10T13:21:50.061549+00:00 app[web.1]: [2024-07-10 13:21:50 +0000] [10] [INFO] Worker exiting (pid: 10) 2024-07-10T13:21:50.085093+00:00 app[web.1]: [2024-07-10 13:21:50 +0000] [2] [ERROR] Worker (pid:9) exited with code 3 2024-07-10T13:21:50.087831+00:00 app[web.1]: [2024-07-10 13:21:50 +0000] [2] [ERROR] Worker (pid:10) was sent SIGTERM! 2024-07-10T13:21:50.185574+00:00 app[web.1]: [2024-07-10 13:21:50 +0000] [2] [ERROR] Shutting down: Master 2024-07-10T13:21:50.185594+00:00 app[web.1]: [2024-07-10 13:21:50 +0000] [2] [ERROR] Reason: Worker failed to boot. 2024-07-10T13:21:50.247002+00:00 heroku[web.1]: Process exited with status 3 2024-07-10T13:21:50.269883+00:00 heroku[web.1]: State changed from starting to crashed 2024-07-10T13:25:54.455799+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=som-new-d24d184e5f65.herokuapp.com request_id=cf32023d-75dc-4894-ad38-c91355faf511 fwd="74.69.211.245" dyno= connect= service= status=503 bytes= protocol=https 2024-07-10T13:25:54.918719+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=som-new-d24d184e5f65.herokuapp.com request_id=8e5b95aa-34b6-438d-b73f-ebfcdb7244c8 fwd="74.69.211.245" dyno= connect= service= status=503 bytes= protocol=https 2024-07-10T13:25:57.666954+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=som-new-d24d184e5f65.herokuapp.com request_id=58af5573-8da8-46fa-ac27-eaeb6ca95a03 fwd="74.69.211.245" dyno= connect= service= status=503 bytes= protocol=https 2024-07-10T13:25:57.921350+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=som-new-d24d184e5f65.herokuapp.com request_id=91696db5-a220-41fb-9af2-0954897ff6e4 fwd="74.69.211.245" dyno= connect= service= status=503 bytes= protocol=https 2024-07-10T13:36:51.535272+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=som-new-d24d184e5f65.herokuapp.com request_id=97041cc1-37dd-48b6-a4da-1b055f06ff48 fwd="74.69.211.245" dyno= connect= service= status=503 bytes= protocol=https 2024-07-10T13:36:51.724709+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=som-new-d24d184e5f65.herokuapp.com request_id=4049c47e-3cc2-48de-a452-6cf68b9f74bb fwd="74.69.211.245" dyno= connect= service= status=503 bytes= protocol=https 2024-07-10T13:36:52.562473+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=som-new-d24d184e5f65.herokuapp.com request_id=e358ab3a-6752-41c6-9741-d87227a31929 fwd="74.69.211.245" dyno= connect= service= status=503 bytes= protocol=https 2024-07-10T13:36:52.741928+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=som-new-d24d184e5f65.herokuapp.com request_id=338fd2f1-0bbe-45e3-a8ae-30f20e669608 fwd="74.69.211.245" dyno= connect= service= status=503 bytes= protocol=https

4
  • 2
    Please provide enough code so others can better understand or reproduce the problem.
    – Community Bot
    Commented Jul 10 at 1:16
  • Show us exactly how you installed the cloudinary module. Commented Jul 10 at 1:33
  • Hi, what kind of error does it show? You can try using pip show to see if you can see the module. If it is installed in a different location. You can add paths by import sys and sys.path.append('yourpath') when you use it. Then try using import cloudinary_storage and see if that solves the problem.
    – Jeanneli
    Commented Jul 10 at 5:21
  • All modules must be declared at built time on Heroku. Make sure you've added Cloudinary to your requirements.txt or Pipfile, then redeploy. (And if you have both of those files, pick the tooling you prefer and delete the other one.)
    – Chris
    Commented Jul 11 at 15:16

0