python - 当 conetxt 包含路径时,Django 无法在模板中显示上下文
问题描述
通常我可以显示我的上下文中存在的任何变量,它可以工作。但是在这里,当我想在模板中显示一个包含路径的变量上下文时,它不起作用。我的路径在上下文变量中,因为我可以在控制台中打印他。我只遇到带有路径的上下文变量的这个问题
视图.py
def step0(request):
context = {}
if request.method == 'POST':
context['GV.Levels_m0'] = GV.Levels_m[0]
print(context['GV.Levels_m0'])
else :
None
return render(request,"template.html",context)
模板:
{% if export_process_done %}
<div class="alert alert-success"><b>Done</b>.The files are exported to {{ GV.Levels_m0 }} </div>
{% endif %}
我的控制台:C:\Users\exex\Documents\name\WebApp\Application\media\projectname\process
解决方案
推荐阅读
- php - Laravel 5.5 HasManyThrough 关系
- azure - 如何在 Azure 中的应用服务之间共享应用程序设置?
- twig - 使用 CodeIgniter 设置 Twig 时出错
- android - 回收站视图未在三星 S8 中显示项目
- bash - Shell 脚本循环是/否
- excel - PowerBI、筛选、搜索并根据结果 DAX 创建新表
- c++ - 用于数组数组的 opengl glUniform (ARB_arrays_of_arrays)
- markdown - 带有 Gravizo 的 Markdown BitBucket wiki 中的 PlantUML 图像
- java - Android:在islatedProcess中获取空值
- jquery - 如何使用jquery在多个数组中过滤长度大于零的数组?