[Answered ]-How can I make my Django API only accept requests that come from my website itself?

1👍

By using ‘’cross-origin resource sharing (CORS)’’

In Django settings you can set a list of all domains where requests to your API server are allowed to originate.

Like so

CORS_ALLOWED_ORIGINS = [ "http://localhost:8080", "http://127.0.0.1:9000" ]

Here is a detailed reference on how to set it up

Leave a comment