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!

4

2 回答 2

1

Django 专门查找子目录。请参阅find_commands中的功能core/management/init.py。所以它显然不适用于鸡蛋。简单的解决方法是不要将您的应用程序作为鸡蛋分发。无论如何,现在只有很少的充分理由这样做。

你可以告诉安装程序在 setup.py 文件中解压鸡蛋。有关详细信息,请阅读此 SO 答案。在这种情况下,管理命令应该可以工作。

于 2013-01-14T14:00:12.937 回答
0

即使你把它打包成一个例子,你仍然需要它在你的installed_appsfor django 中来获取它。

于 2013-01-14T13:45:32.147 回答