Hi
I have a Flask application which does not seem to get executed after its deployment.
This application was successfully running on Heroku deployment.
I tried to run the same command as the one used for Heroku deplyoment as described here but I am getting the following error:
Hey Marco. Do you mind posting your Start Command? I noticed there’s a double quote to the left of the word “app” in the following line: ModuleNotFoundError: No module named '"app', I wonder if the error is related to that.
Hi Marco. This may not be an issue with Render, but maybe with your folder structure and app.py module. Additionally, I just learned that in the gunicorn app:app command, the first “app” is the name of your Python module (e.g., app.py), and the second “app” is the variable name of the Flask instance inside app.py (e.g., app = Flask(__name__)).
With that being said, assuming that your Flask instance is called create_main_and_celery_apps and the app.py module is in the project’s src folder, try any of the following:
Lastly, you should be able to test this locally on your machine, which might be faster than waiting to redeploy on Render (see below). I hope this helps. Have fun!
I just learned that a Root Directory optional field exists in the Settings menu of your Render Flask service instance. You could also try filling this field with src and updating your Start Command to the following below (Disclaimer: I have not tested this myself ).
Hi Bryan
thanks for your help. I figured out that the problem was due the quotes in the command. Once removed the application is launched successfully
Thanks again