8 months ago
hi guys, i recently switched my flask app to a more modular approach using blueprints but now im having issues when trying to deploy i think this the more valuable piece of information in logs: Failed to find attribute 'app' in 'app'.
My project folder structure would be something like /app/init.py as my entrypoint, I have set the FLASK_APP env var to app and i have the procfile with the web: gunicorn app:app --bind 0.0.0.0:$PORT in it, any hints ?
0 Replies
8 months ago
does that command work to run the application locally?
8 months ago
you should be testing with that command locally to make sure it works
So, it wasn't a kind advice, but it was a good advice, findins: you can't run gunicorn on windows, but you can run it using wsl, as I changed my app to a modular approach the app variable wasn't available because it was created by the factory function in the init.py. Solution, you could move the app = Flask(name) to the outer scope or you can modify your Procfile to web: gunicorn 'app:create_app()' --bind 0.0.0.0:$PORT
Thank you again, i had not use* wsl in a long time, you made me get* my hands dirty 🙂 can be marked as solved 👍
8 months ago
Awesome glad you could solve