In Django I m trying set the CSP headers but it is not setting. I tried with various methods but it doesn't works. I used to code in settings.py but CSP headers not set in Django.
CSP_REPORT_URI = example.com CSP_NONCE_SCRIPT = False # True if you want to use it
CSP_NONCE_STYLE = False # True if you want to use it
CSP_FLAG_STRICT = False # True to include strict-dynamic in CSP
CSP_DEFAULT_SRC = ("'self'",)
CSP_OBJECT_SRC = ("'none'",)
CSP_UPGRADE_INSECURE_REQUESTS = True
CSP_INCLUDE_NONCE_IN = ('script-src', )
CSP_SCRIPT_SRC = ("'self'", "cdn.example.com" )
CSP_STYLE_SRC = ("'self'","stackpath.bootstrapcdn.com" )
CSP_FONT_SRC = ("'self'", "fonts.example.com", )
CSP_IMG_SRC = ("'self'", "example.com", "www.example.com")
CSP_CONNECT_SRC = ("'self'", "example.com", "www.example.com")
CSP_FRAME_SRC = ("'none'",)
CSP_FRAME_ANCESTORS = ("'self'", )
CSP_FORM_ACTION = ("'self'", )
CSP_MANIFEST_SRC = ("'self'", )
CSP_WORKER_SRC = ("'self'", )
CSP_MEDIA_SRC = ("'self'", )