求助帖


报错

Reverse for 'article_comment' with arguments '('',)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['comment/article/(?P<article_pk>[0-9]+)/$']

相应配置代码

app_name = 'comments'
urlpatterns = [
    url(r'^comment/article/(?P<article_pk>[0-9]+)/$', views.article_comment, name='article_comment'),
]
<form id="frmSumbit" action="{% url 'comments:article_comment' article.pk %}" target="_self" method="post" >
        # post保护
        {% csrf_token %}
    <input type="hidden" name="inpId" id="inpId" value="75" />
    <input type="hidden" name="inpArticle" id="inpArticle" value="" />
    <input type="hidden" name="inpRevID" id="inpRevID" value="" />
    <p><input type="text" name="inpName" id="inpName" class="text" value="" size="28" tabindex="1" />
        <label for="{{ form.name.id_for_label }}">名称(必填)</label>
        {{ form.name }}
        {{ form.name.errors }}
    </p>
    <p><input type="text" name="inpEmail" id="inpEmail" class="text" value="" size="28" tabindex="2" />
        <label for="{{ form.email.id_for_label }}">邮箱</label>
        {{ form.email }}
        {{ form.email.errors }}
    </p>
    <p><input type="text" name="inpHomePage" id="inpHomePage" class="text" value="" size="28" tabindex="3" />
        <label for="{{ form.url.id_for_label }}">网站链接</label>
        {{ form.url }}
        {{ form.url.errors }}
    </p>
添加一条新回复
登录 或者 注册 后发表回复