简体   繁体   English

Django-dilla“未知命令:'dilla'”

[英]Django-dilla “Unknown command: 'dilla'”

I'm unable to make django-dilla work with my django1.4 project. 我无法使django-dilla与django1.4项目一起工作。 I've installed django-dilla through pip and I can import it properly from shell. 我已经通过pip安装了django-dilla,并且可以从shell正确导入它。

>>import dilla
>>dilla.__file__
'/Users/misterte/.envs/python2.7-Django1.4/lib/python2.7/site-packages/django_dilla-0.2beta-py2.7.egg/dilla/__init__.py'

I've added it to my installed apps just before south, and ran my syncdb command. 我已经将它添加到我在South之前安装的应用程序中,并运行了syncdb命令。

INSTALLED_APPS = (
    [...]
    'dilla',
    'south',
)

But when I try to call it, it won't work. 但是当我尝试调用它时,它将无法正常工作。

$python manage.py dilla --cycles=30
Unknown command: 'dilla'
Type 'manage.py help' for usage.
$python manage.py run_dilla --cycles=30
Unknown command: 'run_dilla'
Type 'manage.py help' for usage.

Then, of course, no sub commands are present under the [dilla] app when running help. 然后,在运行帮助时,[dilla]应用程序下当然没有子命令。

$python manage.py help | grep dilla
# emptiness :(

Any clues? 有什么线索吗? Does dilla work in the django1.4 layout? dilla是否可以在django1.4布局中工作?

Thanks! 谢谢!

A. 一种。

So I found the problem. 所以我发现了问题。

For some reason pip is not installing dilla under site packages. 出于某种原因,pip没有在站点软件包下安装dilla。 I can import dilla and the egg is present under my site-packages folder, but further inspection showed that there were no packages under dilla. 我可以导入dilla,并且鸡蛋在我的site-packages文件夹下,但是进一步检查显示,dilla下没有任何包装。

Solution: copy dilla into you folder manually. 解决方案:将dilla手动复制到您的文件夹中。 I downloaded it from github . 我从github下载了它。

Also, I recommend you copy it to a 'vendor' subfolder in your project. 另外,我建议您将其复制到项目中的“供应商”子文件夹中。 This way you avoid probably having to do the same hack in your production server. 这样,您可以避免在生产服务器中进行相同的操作。 Then you import app as 'vendor.dilla' in your installed apps. 然后,在已安装的应用程序中将应用程序导入为“ vendor.dilla”。

A. 一种。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM