django/django — pull request #2927 by keelung (2014-07-16 01:25:55+00:00)
Title: Failed to load management tools after freezing by cx_freeze

Since it just searching .py but not .pyc files in function of find_commands() in django / core / management / __init__.py, but after freezing there is no .py files.

After changing this line
return [f[:-3] for f in os.listdir(command_dir) if not f.startswith('_') and f.endswith('.py')]
to
return [f[:f.rindex('.')] for f in os.listdir(command_dir) if not f.startswith('_') and (f.endswith('.py') or f.endswith('.pyc'))]

and it worked.