首页 > 解决方案 > Django 从谷歌云媒体位置加载模板

问题描述

我已经创建了一个 html 文件并将其上传到谷歌云媒体位置,我正在尝试使用下面的代码获取该 html 内容,但我无法获取模板对象。

from django.template import loader
template_name = 'http://storage.googleapis.com/media/templates/real.html'
template = loader.get_template(template_name)

有没有办法获取 django 模板对象?

标签: djangopython-3.xdjango-templatesgoogle-cloud-storage

解决方案


推荐阅读