added cors Allow specific origins setting, unpublish article api, pagination in notification list

This commit is contained in:
abutalib-kiwi
2023-09-04 15:46:36 +05:30
parent ec585d35f3
commit a211baa10a
5 changed files with 36 additions and 7 deletions

View File

@ -37,7 +37,17 @@ SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = os.getenv('DEBUG')
# cors allow setting
CORS_ORIGIN_ALLOW_ALL = True
CORS_ORIGIN_ALLOW_ALL = False
# Allow specific origins
CORS_ALLOWED_ORIGINS = [
"https://dev-api.zodqaapp.com",
"https://qa-api.zodqaapp.com",
"https://stage-api.zodqaapp.com",
# Add more trusted origins as needed
]
# if DEBUG:
# CORS_ALLOWED_ORIGINS += ["http://localhost:3000"]
# allow all host
ALLOWED_HOSTS = ['*']
@ -53,7 +63,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Add Django rest frame work apps here
# Add Django rest framework apps here
'django_extensions',
'storages',
'drf_yasg',