Flask-User-starter-app icon indicating copy to clipboard operation
Flask-User-starter-app copied to clipboard

Running a production server

Open hakim89 opened this issue 9 years ago • 3 comments

i see you have gunicorn in the requirements.txt but i can't seem to able to run the application using gunicorn ? any help ?

hakim89 avatar Aug 11 '15 20:08 hakim89

I am also having trouble deploying this app. I tried on PythonAnywhere and Heroku. I am getting a 404 on both. Anyone any ideas?

marcuskelly avatar Apr 06 '17 17:04 marcuskelly

This is due to not calling init_app in manage.py. I fixed this by changing manage.py to be:

# This file starts the WSGI web application.
# - Heroku starts gunicorn, which loads Procfile, which starts manage.py
# - Developers can run it from the command line: python runserver.py

from app.init_app import app, init_app, manager

init_app(app)

# Start a development web server, processing extra command line parameters. E.g.:
# - python manage.py init_db
# - python manage.py runserver
if __name__ == "__main__":
    manager.run()

ghost avatar Aug 17 '17 23:08 ghost

This worked for me.

Thank you.

marcuskelly avatar Aug 18 '17 21:08 marcuskelly