I have a script which uses the Django ORM features, amongst other external libraries, that I want to run outside of Django (that is, executed from the command-line).
Edi
a simple way:
$ python manage.py shell -c 'import runpy; runpy.run_path("scripts/script_to_run.py")'
where scripts/script_to_run.py is the desired script to run!
you can create a bash script called "runscript.py":
#!/bin/bash
python manage.py shell -c 'import runpy; runpy.run_path("'$1'")'
then run:
$ runscript.py scripts/script_to_run.py