Django 报ckeditor/skins/moono/skin.js 404
Posted 深圳-风尘
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Django 报ckeditor/skins/moono/skin.js 404相关的知识,希望对你有一定的参考价值。
环境:
- Django:v3.2.5 (pip list查看版本号)
- django-ckeditor:v6.1.0
bug描述:在admin后台,进行编辑文章的时候,在console控制台里报了ckeditor/skins/moono/skin.js 404
bug原因:
- 分析:一定是
site-packages
里ckeditor
里缺少了skin.js
导致的 - 查看git源码是否有人提issue:还真有 https://github.com/django-ckeditor/django-ckeditor/issues/649
- 查看git源码:v6.1.0版本里的确缺失了
ckeditor/skins/moono/skin.js
bug影响面积:暂时没有看出来影响了皮肤的哪里(你们知道可以告诉我)
bug当时解决办法:
- 下载
skin
:https://github.com/ckeditor/ckeditor4/edit/master/skins/moono/skin.js
- 将skins,放到目录里
bug解永久决方案:ckeditor
的作者修复这个bug
Hole yor life get everything if you never give up.
python django启动报错
创建好django项目之后,runserver启动报错……
Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). 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. April 05, 2019 - 21:59:41 Django version 2.2, using settings \'yaradish.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 "c:\\program files (x86)\\python37-32\\Lib\\threading.py", line 917, in _bootstrap_inner self.run() File "c:\\program files (x86)\\python37-32\\Lib\\threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "E:\\python\\demo-yaradish\\lib\\site-packages\\django\\utils\\autoreload.py", line 54, in wrapper fn(*args, **kwargs) File "E:\\python\\demo-yaradish\\lib\\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 "E:\\python\\demo-yaradish\\lib\\site-packages\\django\\core\\servers\\basehttp.py", line 203, in run httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6) File "E:\\python\\demo-yaradish\\lib\\site-packages\\django\\core\\servers\\basehttp.py", line 67, in __init__ super().__init__(*args, **kwargs) File "c:\\program files (x86)\\python37-32\\Lib\\socketserver.py", line 452, in __init__ self.server_bind() File "c:\\program files (x86)\\python37-32\\Lib\\wsgiref\\simple_server.py", line 50, in server_bind HTTPServer.server_bind(self) File "c:\\program files (x86)\\python37-32\\Lib\\http\\server.py", line 139, in server_bind self.server_name = socket.getfqdn(host) File "c:\\program files (x86)\\python37-32\\Lib\\socket.py", line 676, in getfqdn hostname, aliases, ipaddrs = gethostbyaddr(name) UnicodeDecodeError: \'utf-8\' codec can\'t decode byte 0xd1 in position 0: invalid continuation byte
原因及解决方案:
一般来说编码错误是由中文引起的。从 traceback 最后一栈落在 gethostbyaddr 上可以看出:你电脑的主机名多半是设成了中文了。然后查看了自己的主机名,确实为中文
修改计算机主机名为英文
查看主机名
计算机右键属性,点击高级系统设置,图中标记即为主机名,修改如箭头步骤所示。修改后要重启电脑。
以上是关于Django 报ckeditor/skins/moono/skin.js 404的主要内容,如果未能解决你的问题,请参考以下文章
python---补充django中文报错,Django3.5出错