makemigration for clean project

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>, i added autentication to my installed app list, now i want to make migration but “source code string cannot contain null bytes error”

what should i do?

Copy and paste the complete traceback here

Traceback (most recent call last):
File “D:\Django\project\”, line 22, in
File “D:\Django\project\”, line 18, in main
File “C:\Python311\Lib\site-packages\django\core\”, line 442, in execute_from_command_line
File “C:\Python311\Lib\site-packages\django\core\”, line 416, in execute
File “C:\Python311\Lib\site-packages\”, line 24, in setup
File “C:\Python311\Lib\site-packages\django\apps\”, line 116, in populate
File “C:\Python311\Lib\site-packages\django\apps\”, line 269, in import_models
self.models_module = import_module(models_module_name)
File “C:\Python311\Lib\”, 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

can you share your DB config

‘default’: {
‘ENGINE’: ‘django.db.backends.postgresql’,
‘NAME’: ‘old_database’,
‘USER’: ‘user1’,
‘PASSWORD’: ‘User124082023’,
‘HOST’: ‘localhost’,
‘PORT’: ‘5432’,

py inspectdb > authentication/

worked fine.
Is that means the DB config is working?

Is this some old DB that you are using

only the name is this, it is postgreqsl 14, up and run

There seems to be a damaged source file that contain an invalid character.

thank you so much, but i just installed python + django

@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 file, that would be the file I would check.

thank you so much, i deleted my project, and created from first, also i checked without Inspect, the result was same,

I see you’re using Python 3.11. What version of Django are you using?

C:\Windows\System32>django-admin --version

How are you creating your project?

What precisely do you mean by:

1- django-admin startproject my_project_name
2- cd my_project_name
3- py startapp authentication
4- config DB… in file
5- python inspectdb > authentication/
6- verify manually models with DB tables
7- add app (authentication) to installed apps in
8- python makemigrations >>> Error