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())
More Related Contents:
- How do I activate a virtualenv inside PyCharm’s terminal?
- django html template can’t find static css and js files
- How do I include image files in Django templates?
- Favorite Django Tips & Features?
- Site matching query does not exist
- Use Django ORM as standalone [duplicate]
- difference between filter with multiple arguments and chain filter in django
- Serializing Foreign Key objects in Django
- How to check if a user is logged in (how to properly use user.is_authenticated)?
- django.db.migrations.exceptions.InconsistentMigrationHistory
- Adding a user to a group in django
- Django Blob Model Field
- Dirty fields in django
- Command not found: django-admin.py
- Import Error: No module named django
- Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding, when trying to start uwsgi
- How to combine multiple querysets in Django?
- django import error – No module named core.management
- Meaning of leading underscore in list of tuples used to define choice fields?
- Easiest way to rename a model using Django/South?
- CSRF verification failed. Request aborted
- Django Python rest framework, No ‘Access-Control-Allow-Origin’ header is present on the requested resource in chrome, works in firefox
- Simple Subquery with OuterRef
- How to upgrade sqlite 3.8.2 to >= 3.8.3
- “[Errno 101] Network is unreachable” when trying to send email using Django
- Django Celery Logging Best Practice
- Django: using and POST
- ImportError: Could not import settings
- Django: When to customize save vs using post-save signal
- how to manually assign imagefield in Django