Getting an error when deploying a Django app to Heroku

Brendan Gaturu

I am trying to deploy a django app but I am getting a push rejected error(Traceback attached). I am using whitenoise to handle the static files and done the correct configuration in settings.py file. This error has really been bugging me .

-----> $ python manage.py collectstatic --noinput
       Traceback (most recent call last):
         File "manage.py", line 21, in <module>
           main()
         File "manage.py", line 17, in main
           execute_from_command_line(sys.argv)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
           utility.execute()
         File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 377, in execute
           django.setup()
         File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
           apps.populate(settings.INSTALLED_APPS)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 91, in populate
           app_config = AppConfig.create(entry)
         File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/config.py", line 116, in create
           mod = import_module(mod_path)
         File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
           return _bootstrap._gcd_import(name[level:], package, level)
         File "<frozen importlib._bootstrap>", line 994, in _gcd_import
         File "<frozen importlib._bootstrap>", line 971, in _find_and_load
         File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
       ModuleNotFoundError: No module named 'whitenoise'
 !     Error while running '$ python manage.py collectstatic --noinput'.
       See traceback above for details.
       You may need to update application code to resolve this error.
       Or, you can disable collectstatic for this application:
          $ heroku config:set DISABLE_COLLECTSTATIC=1
       https://devcenter.heroku.com/articles/django-assets
 !     Push rejected, failed to compile Python app.
 !     Push failed
Brendan Gaturu

The issue was that I was not disabling statics on the app I was to deploy I ran the following command heroku config:set DISABLE_COLLECTSTATIC=1 -app 'appname'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

`collectstatic` error when deploying Django app to heroku

Error when deploying Django-React app to Heroku

Unrecognised error when deploying django app to heroku with git push

Error with collectstatic while deploying Django app to Heroku

Error deploying on Heroku - Django app - collectstatic --noinput

PostgreSQL error when deploying jhipster app on Heroku

Error when deploying Angular app to Heroku

Why am I getting an internal server error when deploying Django with Heroku (admin page still works)?

Getting "Cannot find module '/app/dist'" error on deploying to Heroku

H14 Error regarding favicon when deploying Django app to Heroku

App not compatible with buildpack: error during deploying django app to heroku

Error on deploying django app to Heroku -- TypeError: argument of type 'PosixPath' is not iterable

Running through an environmental error during deploying django app on heroku

Where to run collectstatic when deploying django app to heroku using docker?

Problem in collecting static files when deploying a Django Web App to Heroku

django app in heroku getting worker timeout error

Heroku app successfully deploying, but receiving application error when loading site

Application error when deploying my Rails app to heroku

Why do I obtain this error when deploying app to Heroku?

Discord app error R10 when deploying with Heroku

403 error when deploying a Node.js app on Heroku

"ERROR: No matching distribution found for numpy" when deploying app to Heroku

"Cannot load such file" error when deploying Rails app to Heroku

Deploying Go app to heroku error

deploying flask app to heroku error

Error with deploying springboot app to heroku

error deploying django 2.0 to heroku

Getting error code 247 while deploying django app

Getting account disabled error when deploying an App Engine Flexible project