0

Does flask auto-detect changes to routes?

For example, if i have a route like:

@app.route('/')
def home():
    return "Show homepage"

If this is properly working, will a new route like automatically be accessible at <my-server-ip>/blog when i add this route below ?

 @app.route('/')
    def myblog():
        return "Show myblog"

Full file:

    @app.route('/')
    def home():
        return "Show homepage"
    @app.route('/')
    def myblog():
        return "Show myblog"
    if __name__ == '__main__':
        app.run()

Note: home() is already accessible

CodeTalk
  • 3,571
  • 16
  • 57
  • 92

1 Answers1

1

In prod dev you have to restart gunicorn - kill it and run again.

See other options: gunicorn autoreload on source change

Community
  • 1
  • 1
furas
  • 134,197
  • 12
  • 106
  • 148
  • This is great, thank you. Additionally, wanted to add, if you're using supervisor to control your application, just simply run: sudo supervisorctl restart – CodeTalk Jan 26 '16 at 14:24