def prevent_indexing(func):
 @wraps(func)
 def _added_header(request, *args, **kwargs):
  response = func(request, *args, **kwargs)
  response['X-Robots-Tag'] = 'noindex'
  return response
 return _added_header

def prevent_indexing ( func ) : @ wraps ( func ) def _added_header ( request , * args , ** kwargs ) : response = func ( request , * args , ** kwargs ) response [ 'X-Robots-Tag' ] = 'noindex' return response return _added_header
decorator to prevent a page from being indexable by robots .