我正在尝试传递值(如view
下面的定义)以在模板中使用。
看法
from Scanner.forms import SubmitDomain
from django.http import HttpResponse
from django.shortcuts import render
from django.template.context import RequestContext
#from django.template import loader
def index(request):
return HttpResponse('<h1>Page was found</h1>')
def Scan(request):
## Setup Template.
return render(request, 'VA/index.html',
{'pagetitle': 'Home'},
{'container_content' : 'Testing some content dude!'},
##{'form' : 'form'},
context_instance=RequestContext(request, processors=[]))
form = SubmitDomain(request.POST or None) # A form bound to the POST data
if request.method == 'POST': # If the form has been submitted...
if form.is_valid(): # If form input passes initial validation...
form.cleaned_data['domainNm'] ## clean data in dictionary
form.save()
我在我的模板中使用以下内容:
<title>Website Name - {% block pagetitle %}{% endblock pagetitle %}</title>
{% block container_content %}{% endblock container_content %}
我得到的错误:
ender_to_string() got multiple values for keyword argument 'context_instance'
我究竟做错了什么?
请原谅我的新手。