【发布时间】:2012-05-26 18:45:02
【问题描述】:
我收到一个 TemplateSyntaxError,它只发生在我的开发服务器上,但在本地 django 测试服务器上工作正常。
这是我的全部代码:https://github.com/halitalptekin/HDBlog
这个错误代码:
TemplateSyntaxError at /iletisim/
Could not parse the remainder: '-post-contact-form' from 'contactme-post-contact-form'
在模板 /home/templates/hdbootstrap/django_contactme/form.html 中,第 41 行出错
这是第 41 行
<form id="CF" action="{% url contactme-post-contact-form %}" method="post">{% csrf_token %}
【问题讨论】:
-
你使用的是什么版本的 Django? url 语法在 1.4 和 1.5dev (master) 中是不同的。 docs.djangoproject.com/en/1.4/internals/deprecation/#id3
-
只需将变量名中的连字符改为下划线即可。
标签: django django-forms django-templates django-urls