views.py ファイルに次のようなビューがあります。
def index(request):
c = {}
c.update(csrf(request))
if request.method == 'POST':
form = MyRegistrationForm(request.POST)
if form.is_valid():
form.save()
return HttpResponseRedirect('/accounts/register_success')
args = {}
args.update(csrf(request))
args['form'] = MyRegistrationForm()
return render_to_response('index.html', c), render_to_response('index.html', args)
私のindex.htmlは次のようになります。
<form action="/accounts/auth/" method="post">{% csrf_token %}
<label for="username">User name:</label>
<input type="text" name="username" value="" id="username">
<label for="password">Password:</label>
<input type="password" name="password" value="" id="password">
<input type="submit" value="login" />
</form>
<h2>Register</h2>
<form action="/accounts/register/" method="post">{% csrf_token %}
{{form}}
<input type="submit" value="Register" />
</form>
action="/accounts/auth/" のフォームの c をレンダリングし、action="/accounts/register/" のフォームの args をレンダリングしたい..どうすればそうすることができるでしょうか?