如何正确安装django-nose? [英] How to get django-nose installed correctly?
问题描述
我无法让django-nose运行.
I'm having trouble getting django-nose running.
按照安装说明,我的安装方式是:
Per the installation instructions, I installed by:
- 运行
pip install django-nose
- 在settings.py中将
'django_nose'
添加到INSTALLED_APPS
(包括最后一个应用,以防可能出现应用顺序问题) - 将
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
添加到settings.py
- Running
pip install django-nose
- Adding
'django_nose'
toINSTALLED_APPS
in settings.py (including at as the very last app, in case of possible app order issues) - Adding
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
to settings.py
当我运行测试即manage.py test
时,我得到:
When I run a test i.e. manage.py test
, I get:
django.db.utils.DatabaseError: no such table: django_content_type
我认为我需要同步数据库.我正在使用南方.当我使用manage.py syncdb
时,django_nose
既不会显示在已同步应用程序列表中,也不会显示在未同步(使用迁移)"应用程序列表中.
I figured I need to sync the database. I am using South. When I use manage.py syncdb
, django_nose
doesn't show up in either the list of synced apps nor the list of "Not synced (use migrations)" apps.
最后,当我尝试与南方同步时,即manage.py schemamigration django_nose --initial
,我得到:
Finally, when I try syncing with south anyhow, i.e. manage.py schemamigration django_nose --initial
, I get:
django.core.exceptions.ImproperlyConfigured: App with label django_nose is missing a models.py module.
我在virtualenv中安装了带有南方版本0.7.5的Django 1.4.
I have Django 1.4 with South version 0.7.5 installed in a virtualenv.
我做错了什么?如果没有,我该如何调试此安装问题?
What am I doing wrong? If nothing, how do I go about debugging this install problem?
推荐答案
django-nose手册中的报价似乎是关于应用程序订购的问题:
Looks like it's an issue about apps ordering, a quote from django-nose manual:
与南方一起使用
Using With South
South安装了自己的测试命令,该命令会在测试过程中关闭迁移.确保django-nose在INSTALLED_APPS中位于南方之后,以便使用django_nose的test命令.
South installs its own test command that turns off migrations during testing. Make sure that django-nose comes after south in INSTALLED_APPS so that django_nose's test command is used.
这篇关于如何正确安装django-nose?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!