I am writing some python scripts for my Django project. And I am running it using manage.py and shell.
import json
is not working if I am running it with manage.py and sell.
But it is working if I try without shell and manage.py I don't know why this is happening.
With manage.py and shell: (Not working)
python3 manage.py shell < custom_scripts/imports.py
Error: NameError: name 'json' is not defined
Without manage.py and shell: (Works)
python3 custom_scripts/imports.py
Code inside the script:
import json
print(json.loads("{}"))
Any thoughts?