I am trying to have my API be accessible from a specific subdomain. Currently my Settings.py file is structured as:
ALLOWED_HOSTS = [
'localhost',
'http://localhost:7999'
]
...
...
...
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = [
'http://localhost:8001'
]
CORS_ALLOW_METHODS = [
'DELETE',
'GET',
'OPTIONS',
'PATCH',
'POST',
'PUT'
]
Let's say I wanted the api to be accessible from only localhost:7999, but specifying localhost in the ALLOWED_HOSTS variable makes all the subdomains able to access the API. Is there a way around this without having to use CORs.