

Signal returns a truthy value, the request will be allowed.įor example you might define a handler like this: # myapp/handlers.py from corsheaders.signals import check_request_enabled from myapp.models import MySite def cors_allow_mysites ( sender, request, ** kwargs ): return MySite. Provides the request argument (use **kwargs in your handler to protectĪgainst any future arguments being added).

Number of handlers to the check_request_enabled Django signal, which This can be used to read the list of origins you allow from a model. You can attach code to check if a given request should be allowed. If you have a use case that requires more than just the above configuration,
