2665572581@qq.com

  • 内容:已经解决: settings中BASE_DIR 改成 BASE_DIR = Path(__file__).resolve().parent.parent 对应的是:/Users/xxx/Documents/Django-2.0.13/django/bin/autotest *应用的时候在app下新建static文件如*,app名称为mytest对应的是 xxx/mytest/static/mytest/test.png xxx/mytest/static/mytest/css/base.css *html文件中:* {% load static %} <img src="{% static 'mytest/test.png' %}" alt="1"> <link rel="stylesheet" href="{% static 'mytest/css/base.css' %}">