这是我的 HTML 代码:
{% extends "base.html" %}
{% block content %}
<form class="form-horizontal" action="/application/" method="get">
<div class="control-group">
<label class="control-label" for="userid">User ID</label>
<div class="controls">
<input type="text" id="userid" placeholder="Email">
</div>
</div>
<div class="control-group">
<label class="control-label" for="pass">Password</label>
<div class="controls">
<input type="password" id="pass" placeholder="Password">
</div>
</div>
<div class="control-group">
<div class="controls">
<input type="submit" class="btn" value="Sign in">
<br>
<a href="forgot">Forgot password?</a>
<br>
<a href="change">Change password?</a>
</div>
</div>
</form>
{% endblock %}
在我看来,这是我的功能:
def application(request):
print request.GET
message=[]
for key,value in request.GET:
message.append("%s:%s"%key,value)
return HttpResponse(message)
无论我输入什么,我的'print request.GET'都会打印一个 <QueryDict: {}>
.
我不知道如何调试它。有什么线索吗?