用终端运行django请问为什么运行不了呀

You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
March 08, 2023 - 23:04:42
Django version 2.2, using settings 'ty.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\python37\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "D:\python37\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Lenovo\AppData\Roaming\Python\Python37\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\Lenovo\AppData\Roaming\Python\Python37\site-packages\django\core\management\commands\runserver.py", line 139, in inner_run
ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
File "C:\Users\Lenovo\AppData\Roaming\Python\Python37\site-packages\django\core\servers\basehttp.py", line 203, in run
httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
File "C:\Users\Lenovo\AppData\Roaming\Python\Python37\site-packages\django\core\servers\basehttp.py", line 67, in init
super().init(*args, **kwargs)
File "D:\python37\lib\socketserver.py", line 452, in init
self.server_bind()
File "D:\python37\lib\wsgiref\simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "D:\python37\lib\http\server.py", line 139, in server_bind
self.server_name = socket.getfqdn(host)
File "D:\python37\lib\socket.py", line 676, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd in position 2: invalid continuation byte

setting中有关数据库的配置有没有设置好?然后要执行migrate生成数据库,然后再执行runserver

1.将setting.py中默认的DATABASES配置修改为你测试数据库的配置,不同数据库配置不同,这个可以网上百度;若不改默认配置,用sqlite也可。
2.执行python manage.py migrate命令,看你的python版本,若是python3,执行python3 manage.py migrate;
3.修改完毕再执行python manage.py runserver。

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^