python - I am getting AttributeError in RequestContext in DJango
问题描述
I wanted Pass URL parameter in iframe issue as mentioned Passing URL parameter in iframe issue
I tried using following https://glitch.com/edit/#!/tf-embed-with-params?path=README.md:1:0
Traceback:
Exception Type: AttributeError
Exception Value:
'RequestContext' object has no attribute 'META'
views.py
from django.shortcuts import render
from django.template import RequestContext
def survey(request):
return render(RequestContext(request),'wfhApp/survey.html')
And my html page is as follow:
<!DOCTYPE html>
{% load django_typeform %}
{% load sekizai_tags %}
<html>
<head>
<title>Hello!</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<h1>Hi there!</h1>
<div class="target-dom-node" style="width: 100%; height: 500px;"></div>
<script src="https://embed.typeform.com/embed.js"></script>
<script src="/survey/script.js"></script>
{% typeforms_embed 'https://theother2thirds.typeform.com/to/hNZW30' 'New typeform' '{"hideHeaders": true, "hideFooter": true}' %}
</body>
</html>
urls.py
from django.conf.urls import url
from wfhApp import views
app_name = 'wfhApp'
urlpatterns = [
url(r'^survey/$',views.survey, name='survey'),
]
解决方案
推荐阅读
- laravel - 在 laravel7 中带有创建密码链接的欢迎电子邮件
- sql-server - SQLServerException: 无效的对象名称
- ios - 在列表中加载 WebView 而无需重新加载 webView 内容 SwiftUI
- php - 如何获取图片下方右侧的文本框
- android - 尝试取消绑定服务时出现“服务未注册”错误
- node.js - 续集,multer,nodejs
- swift - 在第一个视图控制器出现后做某事
- php - 如何将图像添加到 sql 数据库
- node.js - 获取 mongodb 数据库中每个类别的产品数量
- python - 如何在 Pygame 模块中碰撞两个图像