maybe fix cors
This commit is contained in:
		
							parent
							
								
									85cd6538b9
								
							
						
					
					
						commit
						727ef36fd8
					
				@ -15,7 +15,6 @@ from pathlib import Path
 | 
				
			|||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
 | 
					# Build paths inside the project like this: BASE_DIR / 'subdir'.
 | 
				
			||||||
BASE_DIR = Path(__file__).resolve().parent.parent
 | 
					BASE_DIR = Path(__file__).resolve().parent.parent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
# Quick-start development settings - unsuitable for production
 | 
					# Quick-start development settings - unsuitable for production
 | 
				
			||||||
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
 | 
					# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -27,7 +26,6 @@ DEBUG = False
 | 
				
			|||||||
CSRF_TRUSTED_ORIGINS = ["https://link.timka.su"]
 | 
					CSRF_TRUSTED_ORIGINS = ["https://link.timka.su"]
 | 
				
			||||||
ALLOWED_HOSTS = ['*']
 | 
					ALLOWED_HOSTS = ['*']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
# Application definition
 | 
					# Application definition
 | 
				
			||||||
 | 
					
 | 
				
			||||||
INSTALLED_APPS = [
 | 
					INSTALLED_APPS = [
 | 
				
			||||||
@ -38,7 +36,8 @@ INSTALLED_APPS = [
 | 
				
			|||||||
    'django.contrib.messages',
 | 
					    'django.contrib.messages',
 | 
				
			||||||
    'django.contrib.staticfiles',
 | 
					    'django.contrib.staticfiles',
 | 
				
			||||||
    'rest_framework',
 | 
					    'rest_framework',
 | 
				
			||||||
    'links'
 | 
					    'links',
 | 
				
			||||||
 | 
					    'corsheaders'
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MIDDLEWARE = [
 | 
					MIDDLEWARE = [
 | 
				
			||||||
@ -49,8 +48,13 @@ MIDDLEWARE = [
 | 
				
			|||||||
    'django.contrib.auth.middleware.AuthenticationMiddleware',
 | 
					    'django.contrib.auth.middleware.AuthenticationMiddleware',
 | 
				
			||||||
    'django.contrib.messages.middleware.MessageMiddleware',
 | 
					    'django.contrib.messages.middleware.MessageMiddleware',
 | 
				
			||||||
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
 | 
					    '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'
 | 
					ROOT_URLCONF = 'link_backend.urls'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEMPLATES = [
 | 
					TEMPLATES = [
 | 
				
			||||||
@ -72,7 +76,6 @@ TEMPLATES = [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
WSGI_APPLICATION = 'link_backend.wsgi.application'
 | 
					WSGI_APPLICATION = 'link_backend.wsgi.application'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
# Database
 | 
					# Database
 | 
				
			||||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
 | 
					# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -87,7 +90,6 @@ DATABASES = {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
# Password validation
 | 
					# Password validation
 | 
				
			||||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
 | 
					# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -106,7 +108,6 @@ AUTH_PASSWORD_VALIDATORS = [
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
# Internationalization
 | 
					# Internationalization
 | 
				
			||||||
# https://docs.djangoproject.com/en/4.2/topics/i18n/
 | 
					# https://docs.djangoproject.com/en/4.2/topics/i18n/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -118,7 +119,6 @@ USE_I18N = True
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
USE_TZ = True
 | 
					USE_TZ = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
# Static files (CSS, JavaScript, Images)
 | 
					# Static files (CSS, JavaScript, Images)
 | 
				
			||||||
# https://docs.djangoproject.com/en/4.2/howto/static-files/
 | 
					# 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'
 | 
					DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
# telegram notifications
 | 
					# telegram notifications
 | 
				
			||||||
ENABLE_TELEGRAM_BOT = True
 | 
					ENABLE_TELEGRAM_BOT = True
 | 
				
			||||||
TELEGRAM_BOT_TOKEN = "6944178018:AAGsK5L14pPiLC2sScM5lf5aqlNtLp2JhZk"
 | 
					TELEGRAM_BOT_TOKEN = "6944178018:AAGsK5L14pPiLC2sScM5lf5aqlNtLp2JhZk"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								requirements.txt
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user