我想解决下面描述的这个问题。在
当我提交表单时,它使用@app.route('/', methods = ['GET', 'POST'])
和POST method
并在ubuntuapache服务器上呈现默认的index.html
。在
这是我写的app.py
文件。在
@app.route('/', methods = ['GET', 'POST'])
def whoami():
try:
if request.method == 'POST':
....
....
return render_template("formElement/mainForm.html", session = session, jsonData = jsonData, jsonDataItm = jsonDataItm, fstListNm = fstListNm, jsonDataAll = jsonDataAll, jsonGrp = jsonGrp)
return render_template('formElement/whoami.html')
except Exception as e:
return str(e)
正如您在这段代码中看到的,当我提交表单时,浏览器应该使用一些参数呈现formElement/whoami.html
页面。
但是当我提交表单时,浏览器会转到Apache服务器上的默认Ubuntuindex.html
页面。在
这是我制作的flask.wsgi
文件。在
{My source}位于 这是 请注意,我已经将主页url设置为 我不知道为什么会发生这个问题。在000-default.conf
中的000-default.conf
文件。在<VirtualHost *:80>
....
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
WSGIDaemonProcess flaskapp threads=5
WSGIScriptAlias /lm_kyan/flaskapp /var/www/html/lm_kyan/flaskapp/flaskapp.wsgi
<Directory flaskapp>
WSGIProcessGroup flaskapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
http://107.150.57.190/lm_kyan/flaskapp/
。在
目前没有回答
相关问题 更多 >
编程相关推荐