Index: django/core/management/__init__.py =================================================================== --- django/core/management/__init__.py (revision 11322) +++ django/core/management/__init__.py (working copy) @@ -50,8 +50,10 @@ try: f, path, descr = imp.find_module(part,path) except ImportError,e: - if os.path.basename(os.getcwd()) != part: - raise e + if sys.modules.has_key(part): + path = os.path.realpath(sys.modules[part].__path__[0]) + elif os.path.basename(os.getcwd()) != part: + raise e while parts: part = parts.pop()