1. 在settings.py中配置静态路径:
# 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('\\','/'),
os.path.join('static'),
)
2. 新建static文件夹并且将
jquery
复制进去
3. 在页面中引入jquery
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="/static/jquery-2.1.4.min.js"></script>
</head>