djangoを学んでいるときに単純なログインメカニズムを構築していますが、ビューコードが正しいです - ドキュメントから貼り付けられた)ブートストラップと私は理由を理解できません。具体的には、(ユーザー名とパスワードのための)request.POST.getの戻り値なし。ブートストラップフォームがdjango(POST)で動作しない
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
\t <meta http-equiv = "X-UA-Compatible" contant = "IE = edge">
\t <meta name = 'viewport' content = 'width = device-width, initial-scale = 1'>
\t
<title>title</title>
<meta name="description" content="Minimal Blogging Platform">
<meta name="author" content="MiBlo">
\t {% load staticfiles %}
<link rel="stylesheet" href="{% static '/css/bootstrap.min.css' %}">
\t <script src="{% static '/js/bootstrap.min.js' %}"></script>
</head>
\t
\t
\t
\t
<body>
\t <h1 align='middle' style="margin-bottom: 80px; margin-top: 80px;">Blogging made (very) minimal</h1>
\t <form action = "/blog/login/" class="form-horizontal col-sm-offset-3" method='post'>{% csrf_token %}
\t \t <div class="form-group">
\t \t <label for="username" class="col-sm-2 control-label">Username</label>
\t \t <div class="col-sm-3">
\t \t \t <input type="text" class="form-control" id="username" placeholder="Username" value="chuj">
\t \t </div>
\t \t </div>
\t \t <div class="form-group">
\t \t <label for="password" class="col-sm-2 control-label">Password</label>
\t \t <div class="col-sm-3">
\t \t \t <input type="password" class="form-control" id="password" placeholder="Password">
\t \t </div>
\t \t </div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-4">
<div class="checkbox">
<label>
<input type="checkbox"> Remember me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-4">
<input type="submit" value="OK">
</div>
</div>
\t <div class="form-group">
\t <div class="col-sm-offset-2 col-sm-4">
\t \t <a href="#">Register</a>
\t \t </div>
\t \t </div>
</form>
</body>
</html>
うーんどのようにそれは私の答えは異なる(またはそれ以上)でしょうか?さらに、あなたが引用したリンクは、初心者が 'name'属性の使い方をはっきりと言うのはあまりにも複雑です。 –
彼はドキュメンテーションへのリンクを投稿しました:D @PraveenKumar – hansTheFranz
@hansTheFranzああ...ああ、それは本当にここで非常に必要です...明確化のおかげで! ':D' –