maybe fix cors

master
timka 2023-11-22 18:10:08 +03:00
parent 85cd6538b9
commit 727ef36fd8
2 changed files with 7 additions and 8 deletions

View File

@ -15,7 +15,6 @@ from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
@ -27,7 +26,6 @@ DEBUG = False
CSRF_TRUSTED_ORIGINS = ["https://link.timka.su"]
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
@ -38,7 +36,8 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'links'
'links',
'corsheaders'
]
MIDDLEWARE = [
@ -49,8 +48,13 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
]
CORS_ALLOW_ALL_ORIGINS = True # If this is used then `CORS_ALLOWED_ORIGINS` will not have any effect
CORS_ALLOW_CREDENTIALS = True
ROOT_URLCONF = 'link_backend.urls'
TEMPLATES = [
@ -72,7 +76,6 @@ TEMPLATES = [
WSGI_APPLICATION = 'link_backend.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
@ -87,7 +90,6 @@ DATABASES = {
}
}
# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
@ -106,7 +108,6 @@ AUTH_PASSWORD_VALIDATORS = [
},
]
# Internationalization
# https://docs.djangoproject.com/en/4.2/topics/i18n/
@ -118,7 +119,6 @@ USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.2/howto/static-files/
@ -130,7 +130,6 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# telegram notifications
ENABLE_TELEGRAM_BOT = True
TELEGRAM_BOT_TOKEN = "6944178018:AAGsK5L14pPiLC2sScM5lf5aqlNtLp2JhZk"

Binary file not shown.