Skip to content

Add support for POST instead of GET requests on clicking menu items. #146

Open
@dylanhillier

Description

@dylanhillier

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions