[Fixed]-NoReverseMatch for Createview

1👍

The url tag takes the reverse name and arguments / keyword arguments as paramaters:

url(r'^lawyers/(?P<lawyerreview_slug>[\w-]+)/createreview/$', LawyerReviewCreate.as_view(), name='lawyerreview_create'),

so in this case it expects your urls name (lawyerview_create) and the lawyerreview_slug as a keyword argument. You are passing it a positional argument that doesn’t seem to exist (lawyer.lawyerreview_create).

Pass the lawyer_slug in like this:

    <button class="review_button" href="{% url 'lawyerreview_create' lawyerreview_slug=lawyer_review.lawyer.lawyer_slug %}">

Leave a comment