django-autocomplete-light:Select2 静态文件未检出
django-autocomplete-light: Select2 static files not checked out
我正在尝试 this tutorial 之后的 Django-autocomplete-light 包,但我遇到了这个错误:
?: (dal_select2.E001) Select2 static files not checked out
HINT: Run git submodule update --init in DAL
我下载 .zip 并使用 pip 安装它,然后在 django.contrib.admin 之前添加到我的 INSTALLED_APPS,实现了一个基于 class 的视图,就像教程一样并注册了它在 urls.py。教程中的反向测试有效,但是当我 运行 服务器时,我收到错误。我错过了什么?
这是完整的回溯:
Unhandled exception in thread started by .wrapper at 0x00000000042B0598>
Traceback (most recent call last):
File "C:\Users\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper fn(*args, **kwargs)
File "C:\Users\lib\site-packages\django\core\management\commands\runserver.py", line 116, in inner_run
self.check(display_num_errors=True)
File "C:\Users\lib\site-packages\django\core\management\base.py", line 472, in check
raise SystemCheckError(msg)
django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:
ERRORS:
?: (dal_select2.E001) Select2 static files not checked out
HINT: Run git submodule update --init in DAL
我没有得到提示。我想我错过了安装的东西,但如果你需要我的代码,请告诉我。提前致谢!
我找到了解决方案。请注意,回购协议 zip/archive 的 pip install 不会自动包含子模块。因此,您需要使用以下命令安装软件包。这将安装包的最新主版本。
pip install -e git+https://github.com/yourlabs/django-autocomplete-light.git#egg=django-autocomplete-light
或
pip install git+https://github.com/yourlabs/django-autocomplete-light.git
最近 documentation 也解决了这个问题。在那里查看 "Note"。
我正在尝试 this tutorial 之后的 Django-autocomplete-light 包,但我遇到了这个错误:
?: (dal_select2.E001) Select2 static files not checked out
HINT: Run git submodule update --init in DAL
我下载 .zip 并使用 pip 安装它,然后在 django.contrib.admin 之前添加到我的 INSTALLED_APPS,实现了一个基于 class 的视图,就像教程一样并注册了它在 urls.py。教程中的反向测试有效,但是当我 运行 服务器时,我收到错误。我错过了什么?
这是完整的回溯:
Unhandled exception in thread started by .wrapper at 0x00000000042B0598>
Traceback (most recent call last):
File "C:\Users\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper fn(*args, **kwargs)
File "C:\Users\lib\site-packages\django\core\management\commands\runserver.py", line 116, in inner_run
self.check(display_num_errors=True)
File "C:\Users\lib\site-packages\django\core\management\base.py", line 472, in check
raise SystemCheckError(msg)
django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:
ERRORS: ?: (dal_select2.E001) Select2 static files not checked out HINT: Run git submodule update --init in DAL
我没有得到提示。我想我错过了安装的东西,但如果你需要我的代码,请告诉我。提前致谢!
我找到了解决方案。请注意,回购协议 zip/archive 的 pip install 不会自动包含子模块。因此,您需要使用以下命令安装软件包。这将安装包的最新主版本。
pip install -e git+https://github.com/yourlabs/django-autocomplete-light.git#egg=django-autocomplete-light
或
pip install git+https://github.com/yourlabs/django-autocomplete-light.git
最近 documentation 也解决了这个问题。在那里查看 "Note"。