[Answered ]-How do you make a url that passes a parameter work in Django?

2👍

✅

You have two issues here:

  1. Remove the trailing / from your pattern, or make it /? so it will be optional.
  2. /d+ will only match digits, and your link also contains other characters. Try [a-z0-9]+ instead.

Complete pattern:

^accounts/confirm/(?P<activation_key>[a-z0-9]+)$

0👍

Remove / from end of your url:

url(r'^accounts/confirm/(?P<activation_key>\d+)$', 'mysite.views.confirm', name='confirm'),

or add / to end of your link:

http://www.example.com/accounts/confirm/4beo8d98fef1cd336a0f239jf4dc7fbe7bad8849a127d847f/

Leave a comment