You want to execute python script from django shell? runscript from django-extensions
  1. python manage.py runscript scripty.py  
A sample script.py to test it out:
  1. from django.contrib.auth.models import User  
  2. print(User.objects.values())