django-simple-menu
django-simple-menu copied to clipboard
Add support for POST instead of GET requests on clicking menu items.
I would like to add a logout/sign out menu item which requires the request to be a POST instead of a get. This is in light of this change: https://code.djangoproject.com/ticket/15619
For example, something like:
Menu.add_item(
"user",
MenuItem(
profile_title,
reverse("logout"),
post_request=True, # <<<<<<<< new arg.
icon="box-arrow-right"
),
)
Then instead of generating a <a href=xxxx />
it generates a <form method="post" .... </form>
If there is an existing clean way of doing this i would also be interested.