Python/Flask web development
Question: I using flask web development to create a mini-web with python 2.7.

    
    
    import settings
    
    from flask import Flask, render_template
    
    app = Flask(__name__)
    app.config.from_object(settings)
    
    @app.route("/")
    def hello():
        return "Hello World!"
    
    @app.route("/login")
    def login_template():
        return render_template("login.html") 
    
    if __name__=="__main__":
        app.run()
    

The `@app.route("/")` is working perfectly fine but i got an error in
`@app.route("/login")` because im tryng to `render_template("login.html")`.

The file is in a directory `/templates/login.html` in the same working
directory

I got this error:

<https://i.gyazo.com/761c169e0d55de45e3dd6c7af346c48c.png>

<https://i.gyazo.com/571c079b44c6216612c16798d57d200a.png>


Answer: The usage of the `url_for` includes a provider parameter, but your code
doesn't use that.

Please change accordingly

    
    
    @app.route('/login/')
    @app.route('/login/<provider>')
    def login_template(provider=None):
        # do something 
    

