custom django management command not working when deployed as egg
Asked Answered
R

2

0

I've made a little django app, only one management command, which is packaged into an egg.

If I unzip the egg into a blank django project, add it to installed_apps, the management command works.

However, when it is easy_installed onto a server and although it's in the path (I can import the Command class on the command line), and in INSTALLED_APPS, the management command isn't registered. It's installed from the egg into the site-packages.

Help!

Rozek answered 14/1, 2013 at 11:54 Comment(0)
G
1

Django specifically looks up subdirectories. See find_commands function in core/management/init.py. So it won't work with eggs obviously. The easy fix would be to not distribute your app as an egg. There are only few good reasons to do it nowadays anyway.

You can tell the installer to unpack eggs in the setup.py file. Read this SO answer for details. In that case management commands should work.

Gratify answered 14/1, 2013 at 14:0 Comment(2)
Thank you Alex, I should have mentioned that the eggs are installed with easy_install. I'll update my question.Rozek
@Oatman, have you tried adding zip_safe=False to setup.py? peak.telecommunity.com/DevCenter/…Gratify
I
0

Even if you package it as an eg, you still need it in your installed_apps for django to pick it up.

Ipoh answered 14/1, 2013 at 13:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.