1、修改settings.py如下
2、根目录下创建static目录
3、启动后可直接访问/static/ 下的资源
import os
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(os.path.dirname(__file__), 'static').replace('\\','/'),
)
2、根目录下创建static目录
3、启动后可直接访问/static/ 下的资源