Django reload current page using a button

Viewed 998

Is there actually any way to simply reload the page in Django I'm currently viewing, preferably at the template with a button?

Why do I need this:

My website displays messages and I simply just want to give the user the ability to click on a button to make the message disappear. To make a message disappear, I have to reload the current page ...

Implementing this in JS is not an option!

Thanks and kind regards

1 Answers

You could add a link to the current page:

<a href="{{ request.get_full_path }}">Reload</a>

You could further style this as a button with CSS. For instance, if you're using Bootstrap, you would add something like class="btn btn-primary".

Related