API KEYS working

This commit is contained in:
2025-10-11 20:21:01 -05:00
parent aef63f1a08
commit e2e8757452
7 changed files with 51 additions and 10 deletions

View File

@@ -45,8 +45,10 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'django_filters',
'corsheaders',
'rest_framework',
'rest_framework.authtoken',
# 'rest_framework.authtoken',
"rest_framework_api_key",
'socials',
'events',
# 'academia_nuts',
@@ -56,6 +58,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
@@ -178,3 +181,12 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOWED_ORIGINS = [
"https://digisnaxx.com",
"https://www.digisnaxx.com",
# "http://localhost:5173",
# "http://127.0.0.1:9000",
]