Javascript 使用普通html页面响应请求,但不加载静态文件

Javascript 使用普通html页面响应请求,但不加载静态文件,javascript,python,django,Javascript,Python,Django,我有一些由外部工具生成的html页面 现在,我需要将这个完整的html文件与.png文件、.js文件和.css文件一起提供给大家 我试着 URL.py中的path('rep/',TemplateView.as#view(template_name=“output/23062020_14_32_44/Report_TC_trial_test.html”)# #结果:加载html文件,但其他文件不加载 从django.http导入HttpResponse 从django.template导入加载器

我有一些由外部工具生成的html页面

现在,我需要将这个完整的html文件与
.png
文件、
.js
文件和
.css
文件一起提供给大家

我试着

URL.py中的
path('rep/',TemplateView.as#view(template_name=“output/23062020_14_32_44/Report_TC_trial_test.html”)#
#结果:加载html文件,但其他文件不加载
从django.http导入HttpResponse
从django.template导入加载器
def stet_报告(请求):
template=loader.get\u template('output/23062020\u 14\u 32\u 44/Report\u TC\u trial\u test.html'))
返回HttpResponse(template.render())
从django.shortcuts导入渲染到响应
def stet_报告(请求):
返回render\u to\u response('output/23062020\u 14\u 32\u 44/Report\u TC\u trial\u test.html')
我所有的尝试都得到了同样的结果


作为说明,我不允许修改html文件。首先,我想指出,html模板/页面是单独加载的

首先加载html页面,然后加载依赖文件:
.png
.svg
.js

url
/static/{your_file}
下面的这些函数和带有
load static
static“file_path”
的模板表达式就像快捷方式一样工作

最后我上传了html页面或
/rep/{id}
url

url中的这些页面以
rep/{file}

所以我添加了
ulr.py

从django.views导入静态
url(r'^rep/(?P.*)$,静态,{'document_root':settings.BASE_DIR+“/stetapp/static”}),
在这一点上,除了我的
.js
文件被检测为
text/plain
content\u-type行,encoding=mimetypes.guess\u-type(str(full\u-path))
中,我所做的只是根据文件的扩展名进行了更正

content_type = 'application/javascript' if file_extension == '.js' else content_type or 'application/octet-stream'

也许内置flatpage会有帮助为什么您认为django将提供不在静态目录中的静态文件,您可能希望使用nginix将其作为静态站点提供,使用框架没有任何意义