मैं बस फ्लास्क सीखना शुरू कर रहा हूं, और मैं एक फॉर्म बनाने की कोशिश कर रहा हूं जो एक पोस्ट विधि की अनुमति देगा।फ्लास्क - पोस्ट त्रुटि 405 विधि अनुमत नहीं
@app.route('/template', methods=['GET', 'POST'])
def template():
if request.method == 'POST':
return "Hello"
return render_template('index.html')
और मेरे index.html:
<html>
<head>
<title> Title </title>
</head>
<body>
Enter Python to execute:
<form action="/" method="post">
<input type="text" name="expression" />
<input type="submit" value="Execute" />
</form>
</body>
</html>
लोड हो रहा है प्रपत्र (यह प्रतिपादन जब यह प्राप्त करता है प्राप्त) ठीक काम करता है यहाँ मेरी विधि है। जब मैं सबमिट बटन पर क्लिक करता हूं, तो मुझे एक पोस्ट 405 त्रुटि मिलती है विधि अनुमत नहीं है। यह हैलो क्यों प्रदर्शित नहीं किया गया है?