0
我views.py:'快譯通' 對象有沒有屬性 '推'
def my_view(request):
if request.method == 'POST':
#code
else:
form = #my_form
context_dict = {}
context_dict['myfield'] = 3
return render(request, 'core/my_template.html', context_dict, {'form': form})
#return render(request, 'core/my_template.html', {'form': form}, context_dict)
#return render_to_response('core/my_template.html', context_dict, {'form': form})
#return render_to_response('core/my_template.html', {'form': form}, context_dict)
它提供了一個AttributeError:'dict' object has no attribute 'push'
我發現this question但既不解決方案爲我工作。
此線以下不給錯誤,但貌似沒有通過任何我使用Django 1.9
謝謝您的幫助({{ myfield }}
沒有打印任何東西)
return render(request, ('core/add_regent.html', context_dict), {'form': form})
。