diff --git a/django/core/management/color.py b/django/core/management/color.py
index 8c7a87f..ec63b11 100644
--- a/django/core/management/color.py
+++ b/django/core/management/color.py
@@ -7,12 +7,31 @@ import sys
 
 from django.utils import termcolors
 
+console_handle = sys.stdout
+
+def patch_console():
+    try:
+        global console_handle
+        from pyreadline import console as _console
+        console_handle = _console.Console()
+        console_handle.closed = False
+        sys.stdout = console_handle
+        sys.stderr = console_handle
+        return True
+    except ImportError:
+        return False
+
 def supports_color():
     """
     Returns True if the running system's terminal supports color, and False
     otherwise.
     """
     unsupported_platform = (sys.platform in ('win32', 'Pocket PC'))
+    if type(sys.stdout) is file:
+        if patch_console():
+            unsupported_platform = False
+    else:
+        unsupported_platform = False
     # isatty is not always implemented, #6223.
     is_a_tty = hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()
     if unsupported_platform or not is_a_tty:
