Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Django ValueError: source code string cannot contain null bytes

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

The Traceback is:

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

I am not too familiar with the Django Framework so this error confuses me, any help would go a long way. Thanks.

like image 732
Bruno Avatar asked Sep 15 '17 23:09

Bruno


1 Answers

Just convert it to UTF-8. That worked for me :)

like image 140
Tim66262 Avatar answered Oct 21 '22 08:10

Tim66262