出于某种原因,静态文件,这是由djangobower.finders.BowerFinder
加载不加载(得到404服务器未找到)Django的亭子:静态文件由BowerFinder加载未发现
设置。 PY
STATIC_ROOT = "/root/Desktop/django-DefectDojo/static/"
STATIC_URL = '/static/'
STATICFILES_DIRS =()
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'djangobower.finders.BowerFinder',
)
BOWER_COMPONENTS_ROOT = '/root/Desktop/django-DefectDojo/components/'
BOWER_INSTALLED_APPS = (
'jquery-ui',
)
INSTALLED_APPS = (
'djangobower',
)
模板
<script src="{% static "jquery-ui/jquery-ui.min.js" %}"></script>
项目结构
-project root
-static
-components
-vendor
-assets
-bower-components
-jquery-ui
-jquery-ui.min.js
我做了./manage.py bower install
后跟一个./manage.py collectstatic
现在,上运行的服务器,我得到一个没有找到。
但是,当我制作STATICFILES_DIRS = ('/root/Desktop/django-DefectDojo/components/vendor/assets/bower_components/',)
时,则会加载静态文件。 但这不应该是BowerFinder
应该这样做的情况。