Flask app deployment, start command?

Hello,

I am very new to render and I am trying to deploy my first flask app here but I am not able to understand what is the “start” command, I followed numerous tutorials that all used guincorn app:app but for some reason it does not work for me?

Any tips on what to do?

Thanks

Hey,

gunicorn is a command that will allow you to start an http server that serves your Flask app.

Please check the quick-start documentation of gunicorn first: https://docs.gunicorn.org/en/latest/run.html so you can get an idea of what the command does.

You should tweak the command depending on how you’ve called/created your app.

If you require any help, please share some error messages, code snippets, etc…

Jérémy, Render Support

Hello,

Thanks for the response, is the first “app” the file name and the second “app” for “app = Flask(name)” I saw a few resources which said, gunicorn app:app is similar to from app import app but I have “app = Flask(name)” inside the file called app.py?

I am very confused, any thing I can do to fix it?

Hey Ridd,

If we look at gunicorn’s documentation, we can see:

Basic usage:

$ gunicorn [OPTIONS] [WSGI_APP]

Where WSGI_APP is of the pattern $(MODULE_NAME):$(VARIABLE_NAME). The module name can be a full dotted path. The variable name refers to a WSGI callable that should be found in the specified module.

So, your module name (file name) + a variable within the module that can be called by gunicorn

You can also have a look at this Flask specific doc: https://flask.palletsprojects.com/en/2.2.x/deploying/gunicorn/

If you’re still having any issues, please let me know and specify which service you’re having an issue with and what error messages are you seeing.

Jérémy, Render Support

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.