【发布时间】:2018-10-30 16:55:21
【问题描述】:
我正在尝试将下载的引导主题集成到我的实时网站中
我在 django 项目的根目录(manage.py 所在的位置)有一个 /static 目录,其中包含我所有的 css/javascript 文件。
来自我的 settings.py
STATIC_URL = '/static/'
STATICFILES_DIR = '/var/www/html/aerocredRoot/static'
在我的 index.html 中
{% load static %}
...href="{% static 'assets/web/.......' %}">
还有我的 urls.py
urlpatterns = [
url(r'^%', views.index),
url(r'^admin/', include(admin.site.urls)),
]
使用 Django 1.11.13。
在带有互联网浏览器的网络检查器上,我不断得到
Using the URLconf defined in Aerocred.urls, Django tried these URL
patterns,in this order:
^$
^admin/
The current URL, static/assets/bootstrap/css/bootstrap.min.css, didn't match any
of these.
我尝试将静态文件夹移动到我的应用程序的子目录,弄乱了 STATIC_ROOT 并做 collectstatic 的东西无济于事。
【问题讨论】:
标签: django python-3.x ubuntu apache2 django-staticfiles