summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-01-11 01:57:22 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-01-11 01:57:22 +0000
commitb94d78772f58da7610f714a32e55e96a1d09bea7 (patch)
treeafe2129f4dabff2cc3cdb4ed8bdf4343d30946fa
parent9080d5ad748e0f528d8fd6af7dca5eb19c14b879 (diff)
Added 'shell' option to django-admin.py and manage.py
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1900 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/management.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/django/core/management.py b/django/core/management.py
index d0d4495e5d..830d585d1a 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -814,6 +814,12 @@ def createcachetable(tablename):
db.db.commit()
createcachetable.args = "[tablename]"
+def run_shell():
+ "Runs a Python interactive interpreter"
+ import code
+ code.interact()
+run_shell.args = ''
+
# Utilities for command-line script
DEFAULT_ACTION_MAPPING = {
@@ -826,6 +832,7 @@ DEFAULT_ACTION_MAPPING = {
'install': install,
'installperms': installperms,
'runserver': runserver,
+ 'shell': run_shell,
'sql': get_sql_create,
'sqlall': get_sql_all,
'sqlclear': get_sql_delete,
@@ -906,7 +913,7 @@ def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING):
sys.exit(1)
else:
action_mapping[action](username, email, password)
- elif action in ('init', 'validate'):
+ elif action in ('init', 'shell', 'validate'):
action_mapping[action]()
elif action == 'inspectdb':
try: