Hi there, title says it:
is it possible to perform a redirection by buttonclick in template to reach directly a specific user-entry in admin panel? And extended: with a context-based url?
what i want to do is reach (for example):
http://127.0.0.1:8000/admin/auth/user/1/change/
by doing something in template like:
<button type="submit" class="btn btn-transparent p-0"
formaction="{% url 'admin:auth_user_{{ user.pk}}_change' %}">
{{ user.username }}
</button>
where {{user.pk}}
would be “1”, of course…
i tried it with the informations from
Django Dokumentation ReverseAdmin URL
But don’t get it done right I’m afraid…
according to this dokumentation, it must be something like:
{% load admin_urls %}
formaction="{% url 'admin:auth_user'|admin_urlname:'change' user.pk %}">
But I only get an 'SafeString' object has no attribute 'app_label'
Error…