1

我想在 django 中使用搜索库

所以我决定使用 django-watson(它告诉我易于安装,易于使用)

我指挥

git clone https://github.com/etianen/django-watson.git

在我的 Django 项目中

并插入watson我的settings.py. INSTALLED_APPS

当我命令

python manage.py migrate

django 找不到watson所以我决定卸载django-watson并重新安装

我指挥

rm -rf django-watson

和命令migrate(检查我什么时候卸载库迁移没有问题)

python manage.py migrate

突然它向我显示错误

Traceback (most recent call last):
    File "manage.py", line 10, in <module>
     execute_from_command_line(sys.argv)
    File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
    File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/core/management/__init__.py", line 327, in execute
django.setup()
    File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
    File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
    File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/apps/config.py", line 116, in create
mod = import_module(mod_path)
    File "/Users/hanminsoo/.pyenv/versions/3.5.1/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 986, in _gcd_import
    File "<frozen importlib._bootstrap>", line 969, in _find_and_load
    File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 986, in _gcd_import
    File "<frozen importlib._bootstrap>", line 969, in _find_and_load
    File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'django-watson'

我认为它已安装在 env 中,但我找不到在哪里django-watson

我想django-watson清楚地删除

请有人帮助我

4

2 回答 2

1

确保您已将其从 settings.py 中的 INSTALLED_APPS 中删除,并且您已在项目中删除了与其相关的所有导入。

于 2016-09-05T08:01:12.330 回答
0

如前所述,您必须django-watson从已安装的应用程序中删除。但这是最初的错误:要安装 watson,您必须添加watson到您的INSTALLED_APPS, 而不是django-watson. 这在文档中有很好的解释

  1. 使用 pip 安装 django-watson:pip install django-watson。
  2. 将“watson”添加到您的 INSTALLED_APPS 设置中。
于 2017-10-09T09:29:14.903 回答