{{ request.scheme }} is not honoring https

It’s likely you need to set SECURE_PROXY_SSL_HEADER to let Django know you’re running under HTTPS.

If that’s not available I documented a WSGI middleware approach at the end of the post here: CSRF and Trusted Origins in Django 4.x+.