Reputation: 396
I'm having trouble deploying a Flask app to Heroku. I've successfully created the app on Heroku, it runs fine locally with Foreman, I've got my Procfile right (I think) and my requirements.txt in the root of the directory. I still have to set up environment variables and a connection to AWS RDS Postgres database I'm using, but I'm not even there yet. My inital push to Heroku keeps failing.
This is my error with I try to git push herok master
:
Counting objects: 219, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (206/206), done.
Writing objects: 100% (219/219), 274.75 KiB | 0 bytes/s, done.
Total 219 (delta 98), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote:
remote: ! Push rejected, no Cedar-supported app detected
remote: HINT: This occurs when Heroku cannot detect the buildpack
remote: to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to my-awesome-app.
remote:
To https://git.heroku.com/my-awesome-app.git`
Here's my Procfile:
web: gunicorn app:app --log-file=-
Here's my filestructure:
\project (git root directory)
Procfile
requirements.txt
[...other files...]
run.py
\venv
\etl
\app
[...other files...]
\static
\templates
I've looked around a lot and haven't found anything to help.
Happy to add any additional information if that'd be helpful. This is very discouraging!
Upvotes: 1
Views: 807
Reputation: 396
I figured it out, this was my mistake. I had *.txt in my .gitignore, and didn't realize I wasn't adding/committing requirements.txt to the git repo. Which...explains why heroku couldn't find it!
Upvotes: 0
Reputation: 174624
In your repository's root directory, type:
echo "python-2.7.10" > runtime.txt
If you are using a different version of Python, see this article for the supported runtimes.
Add runtime.txt
to your git repository and do a push to heroku. It should force it to detect your application as a Python app.
Upvotes: 1