Django在类generic vi中获取语法错误

2024-04-19 19:13:24 发布

您现在位置:Python中文网/ 问答频道 /正文

这些是我的网址

url(r'^$', views.index.as_view(), name='index'),
url(r'^([\w-]+)/$', views.board_lv.as_view(), name='board'),
url(r'^comments/(?P<pk>\d+)/$', views.detail.as_view(), name='detail'), 

以下是相关观点:

^{pr2}$

可在此处找到回溯粘贴:http://dpaste.com/1355104/

任何帮助都将不胜感激,谢谢。在

编辑:原来这是一个缩进问题,我需要找到比gedit更好的东西。在

现在我的html页面似乎无法正常工作,我无法理解:

<h1>/b/{{c_board}}</h1>
<ul>
{% for n in notice_List %}
    <li>
    {% if not n.isText %} 
        <h2><a href="{{ n.content }}">{{ n.title }}</a></h2>(/b/{{n.board}})<br>    
    {% else %}
        <h2><a href= "{% url 'detail' n.id %}">{{ n.title }}</a></h2>(/b/{{n.board}})
        <p>{{ n.content|slice:":100" }}</p>     
    {% endif %}
        <a href="{% url 'detail' n.id %}">Comments</a>{{n.thumbs_up}}   
    </li>
{% endfor %}
</ul>

第一个“/b/”之后的所有内容都不会出现。我想这可能和我的背景有关


Tags: nameboardviewurlindextitleasli