1

I am working through the learning log project in Python Crash Course by Eric Matthes, specifically working on the learning log app. I am trying to deploy to heroku but get this error:

(ll_env) C:\Users\benpg\Documents\Coding\Python\learning_log>git push heroku master
Enumerating objects: 54, done.
Counting objects: 100% (54/54), done.
Delta compression using up to 4 threads
Compressing objects: 100% (46/46), done.
Writing objects: 100% (54/54), 16.54 KiB | 940.00 KiB/s, done.
Total 54 (delta 4), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote:  !     Python has released a security update! Please consider upgrading to python-3.7.3
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.7.4
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to pacific-refuge-12657.
remote:
To https://git.heroku.com/pacific-refuge-12657.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pacific-refuge-12657.git'

Tried everything here including the two other questions linked at the start, no luck.

Here's my requirements.txt:

Django==1.8.4
dj-database-url==0.3.0
dj-static==0.0.6
django-bootstrap3==6.2.2
gunicorn==19.3.0
static3==0.6.1
psycopg2>=2.6.1

Edit: I am using django 2.2.4. My requirements.txt is the way it is because there is a note in the book saying 'if you're using Windows, make sure your version of requirements.txt matches the list shown here regardless of which packages you were able to install'. Why is this?

This is the first requirements.txt I had, autogenerated except for the last line. This one didn't work either, same error message:

dj-database-url==0.5.0
dj-static==0.0.6
Django==2.2.4
django-bootstrap3==11.1.0
gunicorn==19.9.0
pytz==2019.2
sqlparse==0.3.0
static3==0.7.0
psycopg2>=2.6.1
8
  • Do you have your requirements.txt at project root at the same level of manage.py? Also check the spelling. Commented Aug 19, 2019 at 16:10
  • 1
    Django 1.8.4 is years out of date, doesn't receive security updates. There is a mismatch between Django 1.8 which supports up to Python 3.5, and Heroku which supports Python 3.6 and 3.7 (both support Python 2 but you should avoid Python 2 for new projects. Commented Aug 19, 2019 at 16:11
  • Also update Django te latest version. Or at least 1.11.x. Commented Aug 19, 2019 at 16:14
  • 1
    I would avoid following a tutorial written for Django 1.8. Lots has changed since then so you'll hit problems like this. I'm not familiar with the python-crash-course book, so I don't know whether there's a newer version that uses a more up to date version of Django. The pcc repo appears to have a copy of the project updated for Django 2.0 which might help you. Commented Aug 19, 2019 at 16:19
  • @MD. Khairul Basar requirements is in the right directory, spelling checked Commented Aug 19, 2019 at 16:20

1 Answer 1

1

Just had the same issue, changing the Python version back do 3.7.3 fixed it. Was able to build python and execute.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.