Reputation: 1106
I have a link
a href="editYou/{{costumer.slug}}"
and URL parttern
(r'editYou/<?P(costumerSlug>.*)/$', 'editYou'),
that points to method
def editYou(request, costumerSlug):
but Django shows an error:
The current URL, profile/editYou/es, didn't match any of these.
How you help me to find what is the reason?
Upvotes: 2
Views: 71
Reputation: 33661
Your pattern is wrong, it should be
r'editYou/(?P<costumerSlug>.*)/$'
# ^^^^
# not <?P(costumerSlug>.*)
Upvotes: 5
Reputation: 2027
It may be better to name your urls like:
(r'editYou/(?P<costumerSlug>.*)/$', 'editYou', name="edit"),
Then in your templates, you could use:
a href="{% url edit costumer.slug %}"
Upvotes: 2