目前,我正在学习Django课程,以学习有关Web编程的知识,而作为IDLE,我们正在使用PyCharm。
当我在终端(cmd)中写入以下命令时,我收到unicode错误,我搜索了与此相关的其他主题,但找不到正确的答案。 我的意思是我不是要问这个问题。
最后,我将向您发送所有命令和回溯,
我的名字也在我的C:users文件夹名称中也包含Ö和Ü,这就是为什么我认为问题是因为这个原因,这就是为什么我只是卸载python并将其重新安装到D的新文件夹中的原因:问题还没有解决。使用以下代码运行服务器后,我仍然收到相同的错误:
python manage.py runserver
在输入时:
django-admin startproject myblog_
cd myblog_
python manage.py startapp gonderiler
这些,我没有收到任何错误,“ myblog_”是项目名称,“ gonderiler”是应用程序。名称。但是,当我运行服务器时,出现以下错误: 也
python manage.py migrate
无法解决问题。
谢谢!希望我们能一起找到解决方案。 我只是从cmd复制了所有内容(不仅是追溯信息),以使其更加清晰,
Microsoft Windows [Sürüm 6.1.7601]
Telif Hakkı (c) 2009 Microsoft Corporation. Tüm hakları saklıdır.
(yeni_django) D:\yazilim24 django\dnm>django-admin startproject myblog_
(yeni_django) D:\yazilim24 django\dnm>cd myblog_
(yeni_django) D:\yazilim24 django\dnm\myblog_>python manage.py startapp gonderiler
(yeni_django) D:\yazilim24 django\dnm\myblog_>python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
You have 15 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.
August 09, 2018 - 11:19:49
Django version 2.1, using settings 'myblog_.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x035D2618>
Traceback (most recent call last):
File "D:\yazilim24 django\dnm\venv\yeni_django\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "D:\yazilim24 django\dnm\venv\yeni_django\lib\site-packages\django\core\management\commands\runserver.py", line 140, in inner_run
ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
File "D:\yazilim24 django\dnm\venv\yeni_django\lib\site-packages\django\core\servers\basehttp.py", line 164, in run
httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
File "D:\yazilim24 django\dnm\venv\yeni_django\lib\site-packages\django\core\servers\basehttp.py", line 67, in __init__
super().__init__(*args, **kwargs)
File "D:\py37\lib\socketserver.py", line 450, in __init__
self.server_bind()
File "D:\py37\lib\wsgiref\simple_server.py", line 52, in server_bind
HTTPServer.server_bind(self)
File "D:\py37\lib\http\server.py", line 140, in server_bind
self.server_name = socket.getfqdn(host)
File "D:\py37\lib\socket.py", line 677, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in position 11: invalid continuation byte
答案 0 :(得分:1)
大家好,我已经解决了自己的问题; https://www.howtogeek.com/howto/windows-vista/change-your-computer-name-in-windows-vista/
任何人都会遇到同样的问题,只需去用通用字符更改您的计算机名称。程序的路径并不重要。
答案 1 :(得分:0)
只需将更改保存到那些文件中即可解决此问题。 我也有这些错误,只能通过保存文件来解决。