0

So, i have been getting this error for a week now, and every time I reopen or resume a django project, then i run a python command like python manage.py runserver i get this unusually error

$ python manage.py runserver
Traceback (most recent call last):
File "C:\kate\manage.py", line 22, in <module>
main()
File "C:\kate\manage.py", line 11, in main
from django.core.management import execute_from_command_line
File "C:\Python39\lib\site-packages\django\__init__.py", line 1, in <module>
from django.utils.version import get_version
ValueError: source code string cannot contain null bytes

Meanwhile i saw a solution online that says i should convert it to UTF-8 which i don't know where to change that or convert that since i use pycharm, VS Code and Sublime for my projects

1 Answers1

0

so, I figured out what was wrong, it had to do with django.util.version so what I did to solve it was to reinstall Django and also change the current version pip install django==3.2 since I was currently on Django version 4