9

I'm on course Test-Driven Development with Django, Django REST Framework, and Docker (Michael Herman). My problem is that in a locally running container, the admin panel opens without problems, but the container placed on heroku gives an error (Forbidden (403) CSRF verification failed. Request aborted.) .. Where to look? Thanks!

rotor1812
  • 371
  • 2
  • 8

1 Answers1

18

I found a solution. The fact is that in Django 4.0 you need to add CSRF_TRUSTED_ORIGINS=['https://*.YOUR_DOMAIN.COM'] to settings.py

Thanks to Zeedia:

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
rotor1812
  • 371
  • 2
  • 8