0

I'm trying to run my Django application, which used to work fine before. Now, it is showing this strange error, which seems like coming from Django.

Django Version: 4.1

Python Version: 3.10.6 (Docker Image python:3.10.6)

 django shell commands
 Traceback (most recent call last):
   File "/srv/project/./manage.py", line 9, in <module>
     from django.core.management import execute_from_command_line
   File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 16, in <module>
     from django.apps import apps
   File "/usr/local/lib/python3.10/site-packages/django/apps/__init__.py", line 1, in <module>

   File "/usr/local/lib/python3.10/site-packages/django/apps/config.py", line 13, in <module>
   File "/usr/local/lib/python3.10/site-packages/django/apps/config.py", line 62, in AppConfig
   File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 27, in __init__
     from django.utils.deprecation import RemovedInDjango50Warning
   File "/usr/local/lib/python3.10/site-packages/django/utils/deprecation.py", line 5, in <module>
     from asgiref.sync import sync_to_async
 ValueError: source code string cannot contain null bytes
CurlyError
  • 305
  • 2
  • 15
  • This error means that, the problem is not in code, problem is in interpreter – Manoj Tolagekar Sep 27 '22 at 10:26
  • @CurlyError how do you modify files in your project. Are you using notepad/IDE? On windows? – 404pio Sep 27 '22 at 10:34
  • Does this answer your question? [Python: source code string cannot contain null bytes](https://stackoverflow.com/questions/31233777/python-source-code-string-cannot-contain-null-bytes) – 404pio Sep 27 '22 at 10:35
  • No, already checked that. After running `docker system prune -a` to clean everything and rebuilding it, it started working. – CurlyError Sep 27 '22 at 10:37

0 Answers0