NoReverseMatch at /accounts/regist/
u'main' is not a registered namespace とエラーが出ました。
しかし、今mainと定義した箇所はないです。
accountsのアプリのtemplates/registration/accounts
の中のlogin.htmlに
{% extends "registration/accounts/base.html" %} {# ① #} {% block content %} {% if form.errors %} <div class="alert alert-danger" role="alert"> <p>Your usernamne and password didn't match. Please try again.</p> </div> {% endif %} <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title text-center">Log-in to mysite</h3> </div> <div class="panel-body"> <form action="{% url 'login' %}" method="post" role="form"> {% csrf_token %} <div class="input-group" style="margin-bottom:10px"> <span class="input-group-addon"><i class="fa fa-user fa-fw"></i></span> <input id="id_username" name="username" type="text" value="" maxlength="256" placeholder="Username" aria-describedby="sizing-addon1" autofocus required/> {# ② #} </div> <div class="input-group" style="margin-bottom:10px"> <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span> <input id="id_password" name="password" type="password" value="" maxlength="256" placeholder="Pasword" aria-describedby="sizing-addon1" required/> {# ② #} </div> <button type="submit" style="margin-bottom:-20px"><i class="fa fa-sign-in">Login</i></button> <input name="next" type="hidden" value="{{ next }}"/> {# ③ #} </form> </div> </div> {% endblock %}
と記載し、
accountsアプリ内のurls.py に
views.py
あなたの回答
tips
プレビュー