【发布时间】:2021-07-07 04:50:33
【问题描述】:
我想将代码中存在的静态文件json加载到js中以托管swagger。
我的 index.html:
<HTML>
<head>
{% load static %}
</head>
<body>
<script src="{% static "js/script1" %}"></script>
<script>
var json_contents = // Use the static json `js/json1.json` in here?
</script>
</body>
</html>
以上怎么做?
【问题讨论】:
标签: javascript django django-templates django-staticfiles