Fix CORS Issue
Fix CORS Issue in your Django Project when it is deployed to PWS.
What is CORS?
You can read documentation regarding CORS in the MDN Web
How to Fix in Django Project?
-
Go to your Django project folder.
-
In your project's
settings.py
, ensure that you have the following line.CSRF_TRUSTED_ORIGINS = ["https://*.stndar.dev"]
-
Save and commit the changes.
git commit -m "bugfix:add CSRF trusted origin"
-
Push the changes to PWS.
git push pws master
Same Push CommandNote that this uses the same push command as deploying. If you want to do changes, you can use this same command everytime you've made some changes in your computer.