相关疑难解决方法(0)

方法不允许烧瓶错误405

我正在开发一个烧瓶注册表,我收到一个错误:

error 405 method not found.
Run Code Online (Sandbox Code Playgroud)

码:

import os
# Flask
from flask import Flask, request, session, g, redirect, url_for, abort, \
     render_template, flash, Markup, send_from_directory, escape
from werkzeug import secure_filename

from cultura import app

# My app
from include import User

@app.route('/')
def index():
    return render_template('hello.html')

@app.route('/registrazione', methods=['POST']) 
def registration():
    if request.method == 'POST':
        username= request.form.username.data
        return render_template('registration.html', username=username)
    else :
        return render_template('registration.html')
Run Code Online (Sandbox Code Playgroud)

registration.html:

<html>
<head> <title>Form di registrazione </title>
 </head> 

    <body>
    {{ username }}
    <form id='registration' action='/registrazione' method='post'> …
Run Code Online (Sandbox Code Playgroud)

python forms flask

17
推荐指数
1
解决办法
5万
查看次数

标签 统计

flask ×1

forms ×1

python ×1