1.10에서 장고 템플릿을 활성화하려고하는데 올바르게 작동하지 않습니다. 정적 파일 (./manage.py collectstatic)에서 호출되도록 참조 된 모든 것은 html에서 참조되는 위치를 표시하지 않습니다.Django 1.10 템플릿/staticfiles에 이미지가 표시되지 않습니다.
나는 내보기에 수입이 있습니다
from django.shortcuts import render, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.forms import UserCreationForm
from django.template import loader
from django.contrib.auth.decorators import login_required
from .models import Question
from django.template.context_processors import csrf
from django.conf.urls.static import static
것은 여기 내 urls.py
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url(r'^games/', include('games.urls')),
url(r'^accounts/', include('allauth.urls')),
url(r'^admin/', admin.site.urls),
]+static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
내 settings.py
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,"static")
내 기지에서 몇 가지 예입니다. html
{% load static %}
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="description" content="Hosted IT services such as Remote Backup, Disaster Recovery, Hosted Private and Hosted Shared environments, Hosted VoIP Telephony, Connectivity, IT Support and Network Monitoring, Hardware Guaranteed Fix Maintenance, Software Asset Management, Global Purchasing Strategies, Financial Services and Procurement in general.">
<title>Hosted IT | hosting experts providing straightforward solutions</title>
<link rel="stylesheet" type="text/css" href="{% static 'css/jquery.fullpage.min.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static '/css/hostedit.css' %}" />
<script type='text/javascript' src="{% static 'js/headerscripts.js' %}"></script>
<link rel="apple-touch-icon" sizes="57x57" href="{% static 'img/ico/apple-touch-icon-57x57.png' %}">
<link rel="apple-touch-icon" sizes="60x60" href="{% static 'img/ico/apple-touch-icon-60x60.png' %}">
<link rel="apple-touch-icon" sizes="72x72" href="{% static 'img/ico/apple-touch-icon-72x72.png' %}">
나는 장고 문서에서 제시하는 것처럼 게임/정적/게임/img에 파일을 넣으려고 시도했다. 하지만 나는 또한/games/static/img와 함께 작업하려고했지만 어느 것도 작동하지 않는 것 같습니다. 웹 검사 도구를 사용하면 호출 된 이미지와 JS에서 404 오류가 발생합니다.
1.10과 함께 누락 된 것이 있습니까?