Flask - POST Error 405 Method Not Allowed Flask - POST Error 405 Method Not Allowed python python

Flask - POST Error 405 Method Not Allowed


Your form is submitting to / when the method is routed for /template unless that is a typo, you should adjust your form's action attribute to point at the template view: action="{{ url_for('template') }}"


Replace:

 <form action="/" method="post">

with:

 <form action="{{ url_for('template') }}" method="post">


If you omit the action attribute, the form will post to the current URL.

Replace:

<form action="/" method="post">

with:

<form method="post">