diff -Naurp trunk.orig/django/core/management.py trunk-pystartup/django/core/management.py
--- trunk.orig/django/core/management.py	2007-01-28 23:27:36.000000000 +0100
+++ trunk-pystartup/django/core/management.py	2007-01-28 23:25:56.000000000 +0100
@@ -1194,7 +1194,13 @@ def run_shell(use_plain=False):
             # we already know 'readline' was imported successfully.
             import rlcompleter
             readline.parse_and_bind("tab:complete")
-        code.interact()
+        console = code.InteractiveConsole()
+        filename = os.environ.get("PYTHONSTARTUP")
+        if filename and os.path.isfile(filename):
+            source = open(filename, "r").read()
+            code=compile(source, filename, "exec")
+            console.runcode(code)
+        console.interact()
 run_shell.args = '[--plain]'
 
 def dbshell():
