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!

0atman
  • 3,298
  • 4
  • 30
  • 46

2 Answers2

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.

Community
  • 1
  • 1
alex vasi
  • 5,304
  • 28
  • 31
  • Thank you Alex, I should have mentioned that the eggs are installed with easy_install. I'll update my question. – 0atman Jan 14 '13 at 14:55
  • @Oatman, have you tried adding `zip_safe=False` to setup.py? http://peak.telecommunity.com/DevCenter/setuptools#setting-the-zip-safe-flag – alex vasi Jan 14 '13 at 20:48
0

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

zsquare
  • 9,916
  • 6
  • 53
  • 87