我有一个 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/