Flask无法使用Windows 7

时间:2018-05-01 17:37:51

标签: python flask

我正在尝试从Flask quickstart运行一个最小的应用程序。我安装了Flask,设置FLASK_APP并尝试:烧瓶运行

这是应用代码:

from flask import Flask

app = Flask(__name__)

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

这是控制台答案:

E:\app>flask run
 * Serving Flask app "dapp.py"
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
Traceback (most recent call last):
  File "e:\python365\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "e:\python365\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Python365\Scripts\flask.exe\__main__.py", line 9, in <module>
  File "e:\python365\lib\site-packages\flask\cli.py", line 890, in main
    cli.main(args=args, prog_name=name)
  etc...
  File "e:\python365\lib\site-packages\werkzeug\serving.py", line 577, in __init
__
    self.address_family), handler)
  File "e:\python365\lib\socketserver.py", line 453, in __init__
    self.server_bind()
  File "e:\python365\lib\http\server.py", line 138, in server_bind
    self.server_name = socket.getfqdn(host)
  File "e:\python365\lib\socket.py", line 673, in getfqdn
    hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 0: invalid
start byte

有什么可以做到的?

0 个答案:

没有答案