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
Use runscript from django-extensions: python manage.py runscript
In order to do this, you need to:
pip install django-extensionsscripts. This can be located in your root directory, or in a specific app. Initialize the directory with a blank init file:
touch scripts/__init__.py
Place your script in this directory, and include a run() function. Example:
#hello.py
def hello():
return "Hello, World"
def run():
print hello()
Run the script with python manage.py runscript hello
Refer to docs and helpful blog post for more details.