我已经放下了一个我工作了几个月的Django项目,当我试图重新运行服务器时出现了这个错误:
ValueError: source code string cannot contain null bytes
Traceback是:
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 Framework不太熟悉,所以这个错误让我困惑,任何帮助都会有很长的路要走。感谢。
答案 0 :(得分:1)
只需将其转换为UTF-8。对我有用:)