CORS_ORIGIN_WHITELIST = ( 'google.com', 'hostname.example.com' )
Here is what the above code is Doing:
1. Setting up a CORS whitelist. This is a list of domains that are allowed to access your API.
2. Adding a CORS middleware to your Django application. This middleware will intercept all requests and add the appropriate CORS headers.
3. Adding a CORS filter to your Django application. This filter will intercept all responses and add the appropriate CORS headers.