1π
β
@
is used to decorate
a function. This mechanism is called a decorator
.
A decorator is a function that will modify the behavior of another function.
In your case, the require_http_methods
decorator checks that the request is a GET or a POST method before calling the my_view
function.
Itβs a very powerful mechanism and I do recommend to spend a little time for understanding it. You can start with this tutorial
I hope it helps
π€luc
Source:stackexchange.com