烧瓶“你好世界"不起作用 [英] flask 'hello world' not working

查看:72
本文介绍了烧瓶“你好世界"不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从他们的网站复制粘贴了烧瓶的"hello world"应用程序,并试图运行它.我在Chrome中收到一条错误消息,说

I copy pasted the flask's 'hello world' app from their website and am trying to run it. I get an error message in Chrome saying

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

这是直接来自flasks网站的"hello world"应用程序

Here is the 'hello world' app straight from flasks website

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello World!'

if __name__ == '__main__':
    app.debug = True
    app.run()

我尝试过的事情:

-暂时禁用Avast!

-temporarily disabling Avast!

-禁用Windows防火墙

-disabling windows firewall

-确保已安装flask模块

-ensuring that the flask module is installed

实际上几天前就在工作...

This was working a couple days ago actually...

推荐答案

我不知道为什么,但是当我改变时

I don't know why but when I change

app.run()

app.run(port=4996)

它开始工作.不知道为什么默认端口会引发错误.哦,好吧.

it starts working. No idea why the default port is throwing an error. Oh well.

这篇关于烧瓶“你好世界"不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆