1

The error I get is "CSRF verification failed. Request aborted." Error Image

The site works fine and there are no issues on localhost

I tried adding this base domain in my settings.py but I am still getting the same error: enter image description here

I also tried this fix, and reloaded the requirements.txt but to no avail: enter image description here

Any help would be appreciated.

Huzaifa
  • 13
  • 2
  • Also please make sure that you try to paste the code in your question as code and not image. Take a look at [this](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors#:~:text=You%20should%20not%20post%20code,for%20users%20with%20visual%20impairments.) – Arun T Jun 19 '23 at 15:26

1 Answers1

0

You need to provide the trusted origins like this (if you are using Django 4.0 or above)

CSRF_TRUSTED_ORIGINS must include scheme and host, for Django 4.0 and above. If you are using Django 3.2 and below, this is not required

CSRF_TRUSTED_ORIGINS = ['https://web-production-716d.up.railway.app']
Arun T
  • 1,114
  • 6
  • 17
  • 1
    This worked as I was using Django 4.0 or above. Thank you! Noted on the pasting code and not images. – Huzaifa Jun 19 '23 at 19:17