Why does this fail?...
% echo "import datetime ; [datetime for e in [1, 2]]" > test
% ./manage.py shell < test
Traceback (most recent call last):
File "./manage.py", line 8, in <module>
django.core.management.execute_from_command_line(sys.argv)
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py",
line 381, in execute_from_command_line
utility.execute()
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py",
line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python3/dist-packages/django/core/management/base.py",
line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/lib/python3/dist-packages/django/core/management/base.py",
line 364, in execute
output = self.handle(*args, **options)
File
"/usr/lib/python3/dist-packages/django/core/management/commands/shell.py",
line 92, in handle
exec(sys.stdin.read())
File "<string>", line 1, in <module>
File "<string>", line 1, in <listcomp>
NameError: name 'datetime' is not defined
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/f8990c95-023a-4380-8551-8d0f3ca64fa7n%40googlegroups.com.