jquery - 将现有的 css/html 页面转换为 Django

标签 jquery python html css django

我有一个 jQuery/CSS/html 网页。我想用 Python/Django 添加一些后端。 我将该页面 (index.html) + 所有相关的 css 和 js 文件放入模板文件夹(在 Django 元素文件夹内)。 我将该页面的地址添加到 urls.py 文件和 models.py 文件中。 当我运行服务器并尝试访问该页面时,它显示但没有 css 样式和 javascript 代码。所以,它似乎没有从该 html 网页中获取 css 和 js 文件。怎么了?我错过了什么?

最佳答案

使用 Django,静态文件与主要网页模板分开。参见 the documentation on static files获取更多信息。

关于jquery - 将现有的 css/html 页面转换为 Django,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16389754/

相关文章:

javascript - 如何使用 Bootstrap 禁用幻灯片中的左右箭头

python - ValueError : Failed to find data adapter that can handle input: <class 'NoneType' >, <class 'NoneType' > in keras model.predict

python - Sphinx 将段落标签添加到无序列表项

javascript - 进入css属性,刷新后改,还是修复不了

c# - 我如何向 API 发出 XML 或 JSON 请求

jQuery MouseWheel 事件到捏合事件

javascript - 如何让 .on ("change") 与 gldatepicker 一起使用?

jQuery 从 href 链接中提取 html

python:格式字符串中变量名称中的点

mysql - 如何将HTML5输出标签数据添加到MYSQL中?