1👍
✅
I suspect it is not bootstrapping Django
I would look into making a custom Django management command.
which you can then run with
./manage.py importcsv
This will run a command within the Django environment with all settings initialised correctly
Source:stackexchange.com