chalie001
asked on
error deploying in heroku
hi am geting the following error when deploying in heroku
heroku git:remote --app mzansiapp
set git remote heroku to https://git.heroku.com/mzansiapp.git
django@django-VirtualBox:~/mzansiProject$ git push heroku master
Counting objects: 3397, done.
Compressing objects: 100% (2418/2418), done.
Writing objects: 100% (3397/3397), 18.68 MiB | 453.00 KiB/s, done.
Total 3397 (delta 923), reused 3343 (delta 899)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.7.8
remote: -----> Installing pip 20.0.2, setuptools 39.0.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting beautifulsoup4==4.9.1
remote: Downloading beautifulsoup4-4.9.1-py3-none-any.whl (115 kB)
remote: Collecting certifi==2020.6.20
remote: Downloading certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
remote: Collecting chardet==3.0.4
remote: Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
remote: Collecting dj-database-url==0.5.0
remote: Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB)
remote: Collecting Django==2.2.5
remote: Downloading Django-2.2.5-py3-none-any.whl (7.5 MB)
remote: Collecting django-bootstrap4==1.0.1
remote: Downloading django-bootstrap4-1.0.1.tar.gz (6.8 MB)
remote: Collecting django-cors-headers==3.1.0
remote: Downloading django_cors_headers-3.1.0-py3-none-any.whl (13 kB)
remote: Collecting djangorestframework==3.10.3
remote: Downloading djangorestframework-3.10.3-py3-none-any.whl (909 kB)
remote: Collecting gunicorn==19.9.0
remote: Downloading gunicorn-19.9.0-py2.py3-none-any.whl (112 kB)
remote: Collecting heroku==0.1.4
remote: Downloading heroku-0.1.4.tar.gz (10 kB)
remote: Collecting idna==2.10
remote: Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
remote: Collecting python-dateutil==1.5
remote: Downloading python-dateutil-1.5.tar.gz (233 kB)
remote: Collecting pytz==2020.1
remote: Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
remote: Collecting requests==2.24.0
remote: Downloading requests-2.24.0-py2.py3-none-any.whl (61 kB)
remote: Collecting soupsieve==2.0.1
remote: Downloading soupsieve-2.0.1-py3-none-any.whl (32 kB)
remote: Collecting sqlparse==0.3.1
remote: Downloading sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
remote: Collecting urllib3==1.25.9
remote: Downloading urllib3-1.25.9-py2.py3-none-any.whl (126 kB)
remote: Building wheels for collected packages: django-bootstrap4, heroku, python-dateutil
remote: Building wheel for django-bootstrap4 (setup.py): started
remote: Building wheel for django-bootstrap4 (setup.py): finished with status 'done'
remote: Created wheel for django-bootstrap4: filename=django_bootstrap4-1.0.1-py3-none-any.whl size=158259 sha256=e52d6a4712b68775cefc1e5fc0fdee1794a57a3e7efab6c2a85ceb2364c9869a
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-_pb2n4c_/wheels/0b/c1/78/46559cbfe167349e7f31043f0ec5a40eb827de2450d367cf62
remote: Building wheel for heroku (setup.py): started
remote: Building wheel for heroku (setup.py): finished with status 'done'
remote: Created wheel for heroku: filename=heroku-0.1.4-py3-none-any.whl size=12354 sha256=28baba46d67a06b6bbd30201ee14e4ba0ca5dbf5ca9e71557b46910a9859f4ff
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-_pb2n4c_/wheels/e1/03/d7/ec6e018e04b7b2e9afe6c2ca1047cc5ab1bb266c8586aa1a29
remote: Building wheel for python-dateutil (setup.py): started
remote: Building wheel for python-dateutil (setup.py): finished with status 'done'
remote: Created wheel for python-dateutil: filename=python_dateutil-1.5-py3-none-any.whl size=202993 sha256=becb7492c993afa6435eaa898b54d274d49e7a30504fbcc016936c518ccaa856
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-_pb2n4c_/wheels/33/3c/58/1384eaa15bd3be2988a813b9241241b386b16bf9305f72d300
remote: Successfully built django-bootstrap4 heroku python-dateutil
remote: Installing collected packages: soupsieve, beautifulsoup4, certifi, chardet, dj-database-url, pytz, sqlparse, Django, django-bootstrap4, django-cors-headers, djangorestframework, gunicorn, urllib3, idna, requests, python-dateutil, heroku
remote: Successfully installed Django-2.2.5 beautifulsoup4-4.9.1 certifi-2020.6.20 chardet-3.0.4 dj-database-url-0.5.0 django-bootstrap4-1.0.1 django-cors-headers-3.1.0 djangorestframework-3.10.3 gunicorn-19.9.0 heroku-0.1.4 idna-2.10 python-dateutil-1.5 pytz-2020.1 requests-2.24.0 soupsieve-2.0.1 sqlparse-0.3.1 urllib3-1.25.9
remote: -----> $ python manage.py collectstatic --noinput
remote: Traceback (most recent call last):
remote: File "manage.py", line 21, in <module>
remote: main()
remote: File "manage.py", line 17, in main
remote: execute_from_command_line(sys.argv)
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
remote: utility.execute()
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
remote: self.fetch_command(subcommand).run_from_argv(self.argv)
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
remote: self.execute(*args, **cmd_options)
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
remote: output = self.handle(*args, **options)
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 188, in handle
remote: collected = self.collect()
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
remote: handler(path, prefixed_path, storage)
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 342, in copy_file
remote: if not self.delete_file(path, prefixed_path, source_storage):
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 249, in delete_file
remote: if self.storage.exists(prefixed_path):
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/core/files/storage.py", line 310, in exists
remote: return os.path.exists(self.path(name))
remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/contrib/staticfiles/storage.py", line 44, in path
remote: raise ImproperlyConfigured("You're using the staticfiles app "
remote: django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.
remote:
remote: ! Error while running '$ python manage.py collectstatic --noinput'.
remote: See traceback above for details.
remote:
remote: You may need to update application code to resolve this error.
remote: Or, you can disable collectstatic for this application:
remote:
remote: $ heroku config:set DISABLE_COLLECTSTATIC=1
remote:
remote: https://devcenter.heroku.com/articles/django-assets
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to mzansiapp.
remote:
To https://git.heroku.com/mzansiapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/mzansiapp.git'
ASKER
i did this still failing
heroku config:set DISABLE_COLLECTSTATIC=1
› Warning: heroku update available from 7.47.6 to 7.47.12.
Setting DISABLE_COLLECTSTATIC and restarting ⬢ mzansishopping... done, v7
DISABLE_COLLECTSTATIC: 1
django@django-VirtualBox:~/mzansiProject$ git push heroku master
Counting objects: 3414, done.
Compressing objects: 100% (2435/2435), done.
Writing objects: 100% (3414/3414), 18.68 MiB | 358.00 KiB/s, done.
Total 3414 (delta 936), reused 3339 (delta 899)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Python app detected
remote: ! Python has released a security update! Please consider upgrading to python-3.7.9
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.7.8
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting beautifulsoup4==4.9.1
remote: Downloading beautifulsoup4-4.9.1-py3-none-any.whl (115 kB)
remote: Collecting certifi==2020.6.20
remote: Downloading certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
remote: Collecting chardet==3.0.4
remote: Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
remote: Collecting dj-database-url==0.5.0
remote: Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB)
remote: Collecting Django==2.2.5
remote: Downloading Django-2.2.5-py3-none-any.whl (7.5 MB)
remote: Collecting django-bootstrap4==1.0.1
remote: Downloading django-bootstrap4-1.0.1.tar.gz (6.8 MB)
remote: Collecting django-cors-headers==3.1.0
remote: Downloading django_cors_headers-3.1.0-py3-none-any.whl (13 kB)
remote: Collecting djangorestframework==3.10.3
remote: Downloading djangorestframework-3.10.3-py3-none-any.whl (909 kB)
remote: Collecting gunicorn==19.9.0
remote: Downloading gunicorn-19.9.0-py2.py3-none-any.whl (112 kB)
remote: Collecting heroku==0.1.4
remote: Downloading heroku-0.1.4.tar.gz (10 kB)
remote: Collecting idna==2.10
remote: Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
remote: Collecting Pillow==8.1.0
remote: Downloading Pillow-8.1.0-cp37-cp37m-manylinux1_x86_64.whl (2.2 MB)
remote: Collecting python-dateutil==1.5
remote: Downloading python-dateutil-1.5.tar.gz (233 kB)
remote: Collecting pytz==2020.1
remote: Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
remote: Collecting requests==2.24.0
remote: Downloading requests-2.24.0-py2.py3-none-any.whl (61 kB)
remote: Collecting soupsieve==2.0.1
remote: Downloading soupsieve-2.0.1-py3-none-any.whl (32 kB)
remote: Collecting sqlparse==0.3.1
remote: Downloading sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
remote: Collecting urllib3==1.25.9
remote: Downloading urllib3-1.25.9-py2.py3-none-any.whl (126 kB)
remote: Building wheels for collected packages: django-bootstrap4, heroku, python-dateutil
remote: Building wheel for django-bootstrap4 (setup.py): started
remote: Building wheel for django-bootstrap4 (setup.py): finished with status 'done'
remote: Created wheel for django-bootstrap4: filename=django_bootstrap4-1.0.1-py3-none-any.whl size=158259 sha256=68965954619953870c2df43d4de16aed046202b0275b0c4333847d37b41a019c
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-7rhz4uag/wheels/0b/c1/78/46559cbfe167349e7f31043f0ec5a40eb827de2450d367cf62
remote: Building wheel for heroku (setup.py): started
remote: Building wheel for heroku (setup.py): finished with status 'done'
remote: Created wheel for heroku: filename=heroku-0.1.4-py3-none-any.whl size=12354 sha256=878406b1745c4ae20fb530aa484921ea304ee9169a8c240f0716973d5d95b549
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-7rhz4uag/wheels/e1/03/d7/ec6e018e04b7b2e9afe6c2ca1047cc5ab1bb266c8586aa1a29
remote: Building wheel for python-dateutil (setup.py): started
remote: Building wheel for python-dateutil (setup.py): finished with status 'done'
remote: Created wheel for python-dateutil: filename=python_dateutil-1.5-py3-none-any.whl size=202993 sha256=4a58f92ed3f2796970d1506c48463421f9791d9d52204e004a902d54c9ba968b
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-7rhz4uag/wheels/33/3c/58/1384eaa15bd3be2988a813b9241241b386b16bf9305f72d300
remote: Successfully built django-bootstrap4 heroku python-dateutil
remote: Installing collected packages: soupsieve, beautifulsoup4, certifi, chardet, dj-database-url, pytz, sqlparse, Django, django-bootstrap4, django-cors-headers, djangorestframework, gunicorn, idna, urllib3, requests, python-dateutil, heroku, Pillow
remote: Successfully installed Django-2.2.5 Pillow-8.1.0 beautifulsoup4-4.9.1 certifi-2020.6.20 chardet-3.0.4 dj-database-url-0.5.0 django-bootstrap4-1.0.1 django-cors-headers-3.1.0 djangorestframework-3.10.3 gunicorn-19.9.0 heroku-0.1.4 idna-2.10 python-dateutil-1.5 pytz-2020.1 requests-2.24.0 soupsieve-2.0.1 sqlparse-0.3.1 urllib3-1.25.9
remote: -----> Discovering process types
remote: Procfile declares types -> release, web
remote:
remote: -----> Compressing...
remote: Done: 83.9M
remote: -----> Launching...
remote: ! Release command declared: this new release will not be available until the command succeeds.
remote: Released v8
remote: https://mzansishopping.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
remote: Running release command...
remote:
remote: python3: can't open file './backend/manage.py': [Errno 2] No such file or directory
remote: Waiting for release.... failed.
To https://git.heroku.com/mzansishopping.git
* [new branch] master -> master
django@django-VirtualBox:~/mzansiProject$ ls
datadump.json discussion.txt manage.py onlineapp Procfile requirements.txt static venv
db.sqlite3 dump.json media onlinestore README.md runtime.txt template
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Try this,
disable the collectstatic during a deploy and enable it back after deploy
heroku config:set DISABLE_COLLECTSTATIC=1
after deploy -
heroku run 'bower install --config.interactive=false;grunt prep;python manage.py collectstatic --noinput
heroku config:unset DISABLE_COLLECTSTATIC