Answer the question
In order to leave comments, you need to log in
css is not included in django, where is the error?
settings.py
Connection example.STATIC_URL = os.path.join(BASE_DIR, '/static/')
{% load staticfiles %}
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css'%}">
<link rel="stylesheet" href="{% static 'css/bootstrap-theme.min.css'%}">
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from recipe.views import recipeListView
urlpatterns = [
url(r'^$', recipeListView.as_view(), name='list'),
url(r'^admin/', include(admin.site.urls)),
]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
[29/Oct/2015 01:39:41] "GET / HTTP/1.1" 200 742
[29/Oct/2015 01:39:42] "GET /static/css/bootstrap.min.css HTTP/1.1" 404 1777
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/static/css/bootstrap.min.css
Raised by: django.views.static.serve
'css/bootstrap.min.css' could not be found
Answer the question
In order to leave comments, you need to log in
Solution for developer mode:
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
The solution is to inflate the statics with a normal web server, not Django
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question