本文介绍了Python Django ValueError:源代码字符串不能包含空字节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我放下了一个已经工作了几个月的Django项目,当我尝试重新运行服务器时出现此错误:
I have put down a Django project I was working on for a couple months, when I attempted to re run the server I got this error:
ValueError: source code string cannot contain null bytes回溯是:
C:\Users\Broja\Desktop\mynewenv\computersite>manage.py runserver Traceback (most recent call last): File "C:\Users\Broja\Desktop\mynewenv\computersite\manage.py", line 8, in <module> from django.core.management import execute_from_command_line File "C:\Users\Broja\AppData\Local\Programs\Python\Python35\lib\site- packages\django\__init__.py", line 3, in <module> from django.utils.version import get_version ValueError: source code string cannot contain null bytes我对Django框架不太熟悉,因此此错误使我感到困惑,任何帮助都会走很长一段路.谢谢.
I am not too familiar with the Django Framework so this error confuses me, any help would go a long way. Thanks.
推荐答案只需将其转换为UTF-8.对我有用:)
Just convert it to UTF-8. That worked for me :)
更多推荐
Python Django ValueError:源代码字符串不能包含空字节
发布评论