0

I am new to python so excuse me if this is a silly question.

I came across python code that has @other_functions right on top of def new_function() statements. Could someone please explain the meaning to it?

As in this example:

from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods


@csrf_exempt
@require_http_methods(["post"])
def my_new_function(request):
  ....
  ....
Knu
  • 14,806
  • 5
  • 56
  • 89
Kid_Learning_C
  • 2,605
  • 4
  • 39
  • 71
  • 3
    If I add [tag:decorator] do I spoil the answer? – Knu Apr 11 '16 at 17:56
  • those are decorators, a concept a little too important to cover in a comment. but this link is a good start: https://realpython.com/blog/python/primer-on-python-decorators/ – n1c9 Apr 11 '16 at 18:00
  • Thank you guys for the fast and helpful response! I am reading about python decorators now – Kid_Learning_C Apr 11 '16 at 18:03

0 Answers0