Exception Type: TypeError at /post/
Exception Value: render_to_response() got an unexpected keyword argument 'context_instance'

https://stackoverflow.com/questions/39629793/typeerror-at-post-render-to-response-got-an-unexpected-keyword-argument-con

formtools not supported the Django 1.10 version please downgrade your Django release for the workaround.

https://github.com/django/django-formtools/issues/75

I solved it by some changes in lib/python3.5/site-packages/formtools/preview.py file. Here I first changes render_to_response to render and then removed context_instance=RequestContext(request) from argument. Suppose post_post method now look like:

 def post_post(self, request):
"""
Validates the POST data. If valid, calls done(). Else, redisplays form.
"""
form = self.form(request.POST, auto_id=self.get_auto_id())
if form.is_valid():
if not self._check_security_hash(
request.POST.get(self.unused_name('hash'), ''),
request, form):
return self.failed_hash(request) # Security hash failed.
return self.done(request, form.cleaned_data)
else:
return render(request, self.form_template,
self.get_context(request, form))

It looks like it was already fixed in their repository:

https://github.com/django/django-formtools/blob/master/formtools/preview.py#L88

in this commit:

https://github.com/django/django-formtools/commit/46b6839fb0063fa10ffb896ce80f7155ca7a9f6e

Uninstall django-formtools (pip uninstall django-formtools) and install the library using this this pip command instead:

pip install -e git+git://github.com/django/django-formtools#egg=django-formtools

TypeError at /post/ render_to_response() got an unexpected keyword argument 'context_instance'的更多相关文章

  1. TypeError: parse() got an unexpected keyword argument 'transport_encoding'

    错误: TypeError: parse() got an unexpected keyword argument 'transport_encoding'You are using pip vers ...

  2. TypeError: __init__() got an unexpected keyword argument 't_command'

    python  .\manage.py migrate 报错如下 λ python .\manage.py migrateTraceback (most recent call last): File ...

  3. TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'

    错误: TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' 参照https://blog.c ...

  4. TypeError: to_categorical() got an unexpected keyword argument 'nb_classes'

    在学习莫烦教程中keras教程时,报错:TypeError: to_categorical() got an unexpected keyword argument 'nb_classes',代码如下 ...

  5. TypeError: pivot_table() got an unexpected keyword argument 'rows'

    利用Python进行数据分析>第二章,处理MovieLens 1M数据集,有句代码总是报错: mean_rating = data.pivot_table('rating', rows='tit ...

  6. TypeError: parse() got an unexpected keyword argument 'transport_encoding' 安装tensor后报错

    TypeError: parse() got an unexpected keyword argument 'transport_encoding' 巨蛋疼,出这个问题后,老夫真是醉了,mmp,最后在 ...

  7. Python pika, TypeError: exchange_declare() got an unexpected keyword argument 'type' 问题修复

    网上很多写法都是 type='fanout' 这样的.(这里是基于python=3.6版本, pika=0.13.0 版本) credentials = pika.PlainCredentials(' ...

  8. TypeError: _obtain_input_shape() got an unexpected keyword argument 'include_top'

    报错 Traceback (most recent call last): File "D:/PyCharm 5.0.3/WorkSpace/3.Keras/2.Application中五款 ...

  9. Django TypeError: render() got an unexpected keyword argument 'renderer'

    场景: Xadmin添加plugin 来源: 1. xadmin与DjangoUeditor的安装 (第3.3章节) 2. 增加富文本编辑器Ueditor (第14.7章节) 报错: Django T ...

随机推荐

  1. IOS开发学习笔记018- 一般控件的使用

    1.移动 2.动画 3.缩放 3.旋转 4.简化代码 5.总结 UIButton 的两种状态 normal highlighted  1.移动 OC语法规定:不允许直接修改某个对象中结构体属性的成员. ...

  2. Memcached相关内容总结

    1.Memcached常用命令总结 Memcached命令格式一般为: command 其中描述如下: 参数 描述 command 操作命令,一般为set/add/replace/get/delete ...

  3. (转载)CentOS 6.5使用aliyun镜像来源

    (原地址:http://www.linuxidc.com/Linux/2014-09/106675.htm) 当我们把CentOS 6.5安装好以后,可以使用这个脚本来使用国内的阿里云镜像源 #!/b ...

  4. 【转】UGUI(小地图的实现)与游戏关卡选择的简单实现

    http://www.jianshu.com/p/68637029e9df 游戏中小地图的实现(场景用简单Cube组成先搭建如下图场景,真实场景实现方法也是一样) 图1-1小地图效果图 1.创建好场景 ...

  5. 12c可插拔数据库CDB与PDB管理总结

    12c可插拔数据库CDB与PDB管理总结 创建pdb1.直接创建 CREATE PLUGGABLE DATABASE pdb2 ADMIN USER boswll IDENTIFIED BY orac ...

  6. ALICTF2014 EvilAPK4脱壳分析

    相关文件可以在下面链接中下载: http://pan.baidu.com/s/1sjpvFy9 1 简述 该apk使用libmobisec.so函数实现对dex的解密还原.真正的dex为assets目 ...

  7. vue-element-admin开发模式下style标签热更新失效[解决办法]

    参考:https://forum.vuejs.org/t/vue-cli-3-x-style/46306/3 vue.config.js添加配置 css: { sourceMap: false, mo ...

  8. Request.Form to JSON

    原文发布时间为:2012-03-21 -- 来源于本人的百度文章 [由搬家工具导入] NameValueCollection nvc =newNameValueCollection(Request.F ...

  9. 遍历简单XML节点

    原文发布时间为:2009-08-26 -- 来源于本人的百度文章 [由搬家工具导入] <?xml version="1.0" encoding="gb2312&qu ...

  10. WPF 自动选择dll,以SQLite为例

    在学习sqlite的过程中,发现它的dll是区分32位和64位的,起初觉得很恼火,但是仔细看了下, 发现让程序自行选择dll其实也不是一件很麻烦的事情,如下: 1>创建一个sqlite数据 2& ...