本人刚开始学习。想把自己做的网页
在搭建flask环境架构时,出现下面的错误,也不明白该如何修改了。
网络我切断了,ipv4的IP调整成了固定的IP了。可是还是不能运行
from flask import Flask
app = Flask(name)
@app.route('/')
def index():
return '欢迎来到这里!'
if name == 'main':
app.run(debug=True)
运行上面的代码,却出现错误,没有出现结果。
出现的错误提示如下:
E:\Py\掺配网页制作\venv\Scripts\python.exe E:/Py/掺配网页制作/app.py
- Serving Flask app 'app' (lazy loading)
- Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead. - Debug mode: on
- Restarting with stat
- Debugger is active!
- Debugger PIN: 968-257-472
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\chuntianlxd789\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\chuntianlxd789\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "E:\Py\掺配网页制作\venv\lib\site-packages\werkzeug\serving.py", line 950, in inner
srv = make_server(
File "E:\Py\掺配网页制作\venv\lib\site-packages\werkzeug\serving.py", line 782, in make_server
return ThreadedWSGIServer(
File "E:\Py\掺配网页制作\venv\lib\site-packages\werkzeug\serving.py", line 688, in init
super().init(server_address, handler) # type: ignore
File "C:\Users\chuntianlxd789\AppData\Local\Programs\Python\Python38\lib\socketserver.py", line 452, in init
self.server_bind()
File "C:\Users\chuntianlxd789\AppData\Local\Programs\Python\Python38\lib\http\server.py", line 140, in server_bind
self.server_name = socket.getfqdn(host)
File "C:\Users\chuntianlxd789\AppData\Local\Programs\Python\Python38\lib\socket.py", line 756, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 0: invalid continuation byte