Heroku: Unable to deploy, cannot parse procfile

  deployment, flask, heroku, python

This is what my root directory for the app looks like looks like:

flask-submission-form
 ├ app
 │ ├ templates
 │ │ ├ base.html
 │ │ └ index.html
 │ ├ app.py
 │ ├ extensions.py
 │ └ __init__.py
 ├ assets
 │ └ css
 │ │ ├ custom.css
 │ │ └ main.css
 ├ .env
 ├ .gitignore
 ├ definitions.py
 ├ gulpfile.js
 ├ package-lock.json
 ├ package.json
 ├ postcss.config.js
 ├ Procfile
 ├ README.md
 ├ requirements.txt
 └ tailwind.config.js

This is what the app/ directory looks like:

app
 ├ templates
 │ ├ base.html
 │ └ index.html
 ├ app.py
 ├ extensions.py
 └ __init__.py

My __init__.py contains my main app code, which is like so:

from flask import Flask, request, render_template
import os
from .extensions import register_extensions

def create_app():
    app = Flask(__name__)

    register_extensions(app)

    @app.route("/", methods =["GET", "POST"])
    def index():
        if request.method == "POST":
           #  Do a Bunch of Stuff

And my app.py looks like this:

from app import create_app
app = create_app()

I put this in my Procfile:

web: gunicorn app.app:create_app()

But when I try to deploy this to Heroku, I’m getting the following error:

remote:  !     Push failed: cannot parse Procfile.
remote:  !     Please try pushing again.
remote:  !     If the problem persists, see https://help.heroku.com/ and provide Request ID 28547bd1-bce5-f7f2-e770-b2cb7b73be26.
remote:
remote:
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: fbbc38150c6a8d344932d53a7c40ae4880c288c8
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version fbbc38150c6a8d344932d53a7c40ae4880c288c8
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !

How do I configure my Procfile correctly, given my application structure, so that it can be correctly deployed? If it helps, this is my repo.

Source: Python Questions

LEAVE A COMMENT