I
I
Ilya2016-05-13 13:04:34
Django
Ilya, 2016-05-13 13:04:34

How to output url correctly?

There is a url

url(r'^(?P<slug>[-\w]+)/(?P<id>[-\w]+)/create-feedback/$', feedback_create_id, name='create_feedback_id'),

And I need to specify the url to open the form in the modal window, and in the form action. And it turns out that you need to specify
{% url 'create_feedback_id' order.slug start.id %}
an error when opening the form.
django.core.urlresolvers.NoReverseMatch: Reverse for 'create_feedback_id' with arguments '('', '')' and keyword arguments '{}' not found. 1 pattern(s) tried: ['(?P<slug>[-\\w]+)/(?P<id>[-\\w]+)/create-feedback/$']

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly Scherbakov, 2016-05-13
@nuBacuk

It looks like your variables order.slugare start.ideither empty or undefined. They don't fit, because in the url you have a [-\w]+plus sign that says at least one character must be present (which is logical). And the syntax seems to be correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question