我一直在定製Django-Allauth模板時遇到了麻煩。可能是我的TEMPLATE_DIRS值或我不知道的事情的問題。如果我將TEMPLATE_DIRS指向我的項目目錄中的「Templates/AllAuth」文件夾,它將忽略我的自定義模板。現在,它忽略了我當前的base.html文件和我當前的signup.html/login.html文件,即使報告顯示錯誤來自正確的文件/文件夾。我怎樣才能解決這個問題?Django AllAuth自定義模板不被識別
Unclosed tag 'block'. Looking for one of: endblock
我現在的基本模板:
{% block content %}
{% endblock %}
我signup.html頁,它看起來像上出現的錯誤:
{% load staticfiles %}
{% load url from future %}
{% load i18n %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{% trans "Sign Up" %}</title>
<link rel="stylesheet" type="text/css" href="{% static "stylesheets/sign-up.css" %}" />
<link href="http://fonts.googleapis.com/css?family=Arvo:400,700|Open+Sans" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="logo">
<img id="logo" src="{% static "media/mobile-logo.gif" %}" />
</div>
<div class="wrapper">
<div class="omni-box">
<p>Create Your My_APP Account</p>
</div>
<div class="sign-up-form">
<form id="sign-up" method="post" action="{% url 'account_signup' %}">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Sign Up!" />
</form>
<h3>OR</h3>
<p class="facebook"><img class="social-button" src="{% static "media/facebook.png" %}" />Connect With Facebook</p>
<p class="twitter"><img class="social-button" src="{% static "media/twitter.png" %} />Connect With Twitter</p>
</div>
</div>
</body>
</html>
我的模板設置:
TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader')
TEMPLATE_DIRS = (os.path.join(BASE_DIR, 'templates','allauth'))
並在我的模板/ allauth/accou中nt文件夾,我有我已經定製的所有模板文件。該文件夾位於我的項目目錄中。
這不適合我;仍然不清楚工作是什麼。 – Nancy