Hello @kartik,
The << part is wrong, use < instead:
$ ./manage.py shell < myscript.py
You could also do:
$ ./manage.py shell
...
>>> execfile('myscript.py')
For python3 you would need to use
>>> exec(open('myscript.py').read())
Hope it helps!!
To learn more, join the online course to do Masters in Python.
Thanks!