Hi all,
I created standard django project, i added standard app with name ‘authentication’, i changed DB config to postgreqsl, I have done inspect for read models from db and write into authentication>models.py, i added autentication to my installed app list, now i want to make migration but “source code string cannot contain null bytes error”
Traceback (most recent call last):
File “D:\Django\project\manage.py”, line 22, in
main()
File “D:\Django\project\manage.py”, line 18, in main
execute_from_command_line(sys.argv)
File “C:\Python311\Lib\site-packages\django\core\management_init_.py”, line 442, in execute_from_command_line
utility.execute()
File “C:\Python311\Lib\site-packages\django\core\management_init_.py”, line 416, in execute
django.setup()
File “C:\Python311\Lib\site-packages\django_init_.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “C:\Python311\Lib\site-packages\django\apps\registry.py”, line 116, in populate
app_config.import_models()
File “C:\Python311\Lib\site-packages\django\apps\config.py”, line 269, in import_models
self.models_module = import_module(models_module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Python311\Lib\importlib_init_.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1204, in _gcd_import
File “”, line 1176, in _find_and_load
File “”, line 1147, in _find_and_load_unlocked
File “”, line 690, in _load_unlocked
File “”, line 936, in exec_module
File “”, line 1074, in get_code
File “”, line 1004, in source_to_code
File “”, line 241, in _call_with_frames_removed
SyntaxError: source code string cannot contain null bytes
@addwebsolution isn’t referring to software you’ve installed, but to your project itself. That error you are getting is most frequently seen when a source code file has gotten corrupted somehow.
Since you have directed the output of an inspect command into your models.py file, that would be the file I would check.