Commits

mtredinnick  committed 7f48507

Fixed #9789 -- Handle jython's compiled settings filename correctly.
Patch from Frank Wierzbicki.

  • Participants
  • Parent commits b0aa5a5

Comments (0)

Files changed (2)

     Chris Wesseling <Chris.Wesseling@cwi.nl>
     James Wheare <django@sparemint.com>
     Mike Wiacek <mjwiacek@google.com>
+    Frank Wierzbicki
     charly.wilhelm@gmail.com
     Rachel Willmer <http://www.willmer.com/kb/>
     Gary Wilson <gary.wilson@gmail.com>

File django/core/management/__init__.py

     if project_directory == os.curdir or not project_directory:
         project_directory = os.getcwd()
     project_name = os.path.basename(project_directory)
+
+    # Strip filename suffix to get the module name.
     settings_name = os.path.splitext(settings_filename)[0]
+
+    # Strip $py for Jython compiled files (like settings$py.class)
+    if settings_name.endswith("$py"):
+        settings_name = settings_name[:-3]
+
     sys.path.append(os.path.join(project_directory, os.pardir))
     project_module = __import__(project_name, {}, {}, [''])
     sys.path.pop()