Essentially I’m trying to do the opposite of what django-ds-utils does, which is get URL argument out of a resolved URL, for instance, take the following URL definition:
url(r'^reset_pwd/(?P<code>[A-Za-z0-9]+)/$', ResetPasswordView.as_view(), name='my.registration.views.reset_pwd'),
On that page, within JS, I would like to retrieve <code> into a kwargs array. Is this something that exists, or is there a standard approach to this?
AFAIK there is no standard approach. You can:
…etc.
I personally prefer the second way, e.g. put this code in template and then use _reset_pw_code global in javascript file: