我正在尝试使用Django crispy-forms创建一个Django应用程序。
settings.py
当我运行服务器时,出现错误:
“
我做错了什么?如何修复它?
settings.py
CRISPY_TEMPLATE_PACK = 'bootstrap3'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'face', #app name
'crispy_forms',
)
index.html
{% extends "base.html" %}
{% load crispy_forms_tag %}
{% block title %}
AuthorizedUser
{% endblock title %}
{% block content %}
<h1>Quote of the Day</h1>
<blockquote>{{quote}}</blockquote>
<p>Or, hit reload if you want a new one...</p>
<form method="POST" action="{% url %}" >
{% csrf_token %}
{{ form|crispy}}
<input type="hidden" name="quote" value="{{quote}}" />
<input type="hidden" name="access_token" value="{{access_token}}" />
<input type="submit" value="Set as my status!"/>
</form>
{% endblock content %}
当我运行服务器时,出现错误:
“
TemplateSyntaxError at / 'crispy_forms_tag' is not a valid tag library: Template library crispy_forms_tag not found, trieddjango.templatetags.crispy_forms_tag,django.contrib.staticfiles.templatetags.crispy_forms_tag,django_facebook.templatetags.crispy_forms_tag,crispy_forms.templatetags.crispy_forms_tag
”。我做错了什么?如何修复它?