diff --git a/nba_stats/settings.py b/nba_stats/settings.py index eaeef38..82a83cf 100644 --- a/nba_stats/settings.py +++ b/nba_stats/settings.py @@ -34,7 +34,7 @@ SECRET_KEY = SECRET_DJANGO # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['*'] # Application definition @@ -43,6 +43,7 @@ INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'nba_data', + 'corsheaders', 'rest_framework', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -51,6 +52,7 @@ INSTALLED_APPS = [ ] MIDDLEWARE = [ + 'corsheaders.middleware.CorsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -142,3 +144,8 @@ REST_FRAMEWORK = { 'PAGE_SIZE': 100, # Adjust this value according to the number of records you want to display per page } +CORS_ALLOWED_ORIGINS = [ + "http://localhost:5173", # Replace this with the origin of your frontend app +] + +