I made an HTML-button, in the code shown below:
<div style="" class="button-box" >
<button>Useradministration</button>
</div>
When I click on it, I want it to redirect the user to the /admin-url.
How should I do this? How do I make Django "know" that the button has been clicked?
Thank you so much for your time!
you can use like this:
<a class="btn btn-primary" href="/admin-url">Useradministration</a>
<button onclick="location.href = '/pageurl'">Click</button>
For a button-click redirect to another URL in Django :
<button><a href="/admin">Click</a></button>
Another way :
<button onclick="window.location='projects';">Projects</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With