在联系表单模板夹层中加载外部源,夹层
{% block extra_js %}
{{ block.super }}
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
{% endblock %}
compressor.exceptions.UncompressableFileError: 'https://www.google.com/recaptcha/api.js' isn't accessible via COMPRESS_URL ('/static/') and can't be compressed
答案 0 :(得分:1)
将脚本标记放在{%extra_head%}块中,而不是{%extra_js%}块中。如果您查看基本模板,您会看到{%extra_js%}中的所有内容都通过{%compress%}进行压缩: