Home > Mobile >  JWT authentication does not work in Django Rest Framework after deploying it to IIS on live server
JWT authentication does not work in Django Rest Framework after deploying it to IIS on live server

Time:01-22

I built a Rest API using Django's Rest framework. And I've deployed it on Windows OS's IIS. When I deploy the application to the live IIS server, it throws the following issue even though it functions well on the local IIS server. I have used enter image description here

CodePudding user response:

Maybe the error was in settings.py file because I haven't updated the CORS_ALLOWED_ORIGINS so I changed it as below:

Here's the snippet of code on my local machine

CORS_ALLOWED_ORIGINS = [
    "http://localhost:8000",
    "http://127.0.0.1:8000",
]

Here's the snippet of code on my live server,

CORS_ALLOWED_ORIGINS = [
    "https://www.example.com"
]
  • Related