這裏是我的HTML代碼:簡單的GET請求返回空
{% 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)
這裏不管我怎麼輸入,我的「打印request.GET中」打印<QueryDict: {}>
。
我無法弄清楚如何調試。任何線索?