1. 在settings.py中配置静态路径:
# Additional locations of static filesSTATICFILES_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>
本文介绍如何在Django项目中配置静态文件路径,并通过具体步骤指导如何将jQuery库集成到项目中,包括设置静态文件目录、创建必要的文件夹及引入jQuery到网页。
1493

被折叠的 条评论
为什么被折叠?



