Python Django ValueError:源代码字符串不能包含空字节

编程入门 行业动态 更新时间:2024-10-14 20:24:02
本文介绍了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:源代码字符串不能包含空字节

本文发布于:2023-10-27 10:31:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1533108.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   字节   源代码   Python   Django

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!