[Answer]-URL trouble to pass parameter

1👍

Your problem is that you are missing a leading slash, so the browser is concatenating the URL with the one you’re already on (you’re on ‘/profile’, you click ‘edit’, you go to ‘/profile/edit’).

But you shouldn’t be building up URLs like that. You should use the url tag. Assuming your URLconf is this:

url(r'^edit/(?P<slug>\w+)/$', 'profile.views.edit_profile', name='edit_profile')

you would do this in the template:

<a href="{% url 'edit_profile' slug=costumer.slug %}">

Leave a comment