Q: Login form using Flask-WTForm with Postgresql database Thanks in Advance!!
I did the following things to create a login or Sign in the form:-
1)Created secret key
2)Used LoginManager and passed the app
3)Created a route for login.html
I am getting a Method Not Allowed page when I access the login page on the localhost.
Here is the code:-


app.py


``` 

from flask import Flask, render_template, request, flash, redirect, url_for, session, logging
    from flask_login import LoginManager

    from config import Config

    app = Flask(__name__)
    app.config.from_object(Config)
    app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:password@localhost/learning'
    db = SQLAlchemy(app)
    # LoginManager
    login_manager = LoginManager(app)# Login Form class


@app.route('/login', methods=['GET,''POST'])
def login():

    if request.method == 'POST':
        # get form fields
        username = request.form['username']
        password_candidate = request.form['password']

        # getting user
        login_user = Flask_Users.query.filter_by(username).first()

        if login_user > 0:
            # Get stored hash
            password = login_user.password  # is this right way to get one field from login_user??
            # Compare passwords
            if sha256_crypt.verify(password_candidate, password):
                app.logger.info('PASSWORD MATCHED')

        else:
            app.logger.info('NO user')

    return render_template('login.html')```

login.html
```


 {% extends 'layout.html' %}

    {% block body %}
      <h1>Login</h1>
        {% include 'includes/_messages.html' %}

      <form action="" method="POST">
        <div class="form-group">
          <label>Username</label>
          <input type="text" name="username" class="form-control" value={{request.form.username}}>
        </div>
        <div class="form-group">
          <label>Password</label>
          <input type="password" name="password" class="form-control" value={{request.form.password}}>
        </div>
        <button type="submit" class="btn btn-primary">Submit</button>
      </form>
    {% endblock %}


I followed what was in the documentation page. In the console, I am getting code 405 and error is the pic[enter image description here][1]


  [1]: https://i.stack.imgur.com/fkf0m.png

Any help is appreciated. I did go through relevant posts on the website as well, but could not find anything relatable


A: You have a typo in your code
methods=['GET,''POST']

You need to correct to 
methods=['GET','POST']

