User Registration - Flask Security User Registration - Flask Security flask flask

User Registration - Flask Security


Instead of:

@app.route('/register', methods=['GET', 'POST'])

You need:

@app.route('/register/', methods=['GET', 'POST'])

Note the trailing slash / at the end of '/register/'

From the Flask documentation:

If "(...) the URL is defined without a trailing slash, rather like the pathname of a file on UNIX-like systems. Accessing the URL with a trailing slash will produce a 404 “Not Found” error".


In addition to the posted resolution of including trailing slash while creating url requests- which is necessary to do as per Flask Doc, the problem above was caused due to cache not being cleared. Related question would give more insight into clearing cache with hard reload. Or, simply disable the cache when in dev mode.