management.find_commands makes distribute django app difficultly.
|Reported by:||bear330||Owned by:||jdetaeye|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
django.core.management.find_commands only searches the commands that ends with .py, but if I want to distribute django application to others and don't want to distribute source code, this will be a barrier.
Actually, I want to distribute my django application using py2exe to be a desktop application.
My approach in this time is:
command_dir = os.path.join(management_dir, 'commands')
return [f[:-4] for f in os.listdir(command_dir)
if not f.startswith('_') and f.endswith('.pyo')]
django.core.management.find_commands = find_commands
from django.core.management import ProjectManagementUtility
os.environDJANGO_SETTINGS_MODULE? = 'settings'
utility = ProjectManagementUtility(sys.argv, executableDir)
It looks silly.
If django.core.management.find_commands can search .py, .pyc and .pyo, I don't need to this anymore.
This will make distribute django more easily and more flexible.
Thanks for your effort.
Change History (6)
comment:1 in reply to: ↑ description Changed 7 years ago by bear330
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset