私はDjangoを使い始めたばかりで、可能な限り組み込み機能を使用しようとしています。そのため、ユーザーログインには、組み込みのログインビューを使用して、サイトのベースURLに割り当てています。
urlpatterns=patterns('django.contrib.auth.views',
url(r'^/$','login',{'template':'mytemplate.html'}),
mytemplate.htmlは次のようになります。
<!DOCTYPE html>
<html>
<body>
{%if form.errors %}
<p> Invalid username/password combination, please try again </p>
{% endif %}
<h1>Welcome to My Site!</h1>
<form action="{% url django.contrib.auth.views.login %}" method="post">
{% csrf_token %}
{{form.username.label_tag}}{{form.username}}
{{form.password.label_tag}}{{form.password}}
<input type="submit" id="submit" name="submit" value="Sign in" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
<a href="password_reset/" id="forgot"> forgot username/password</a><br />
<a href="register" id="new">new user</a>
</body>
</html>
私の問題は、テンプレートが想定されているコンテキストのいずれも渡されていないように見えることです。レンダリングされたHTMLでは、すべての変数タグが単純に消えます(つまり、適切な値に置き換えられるのではなく、何も置き換えられません)。
重要なステップをスキップしていると思いますが、それが何であるかわかりません。何か案は?