Skip to content

Latest commit

 

History

History
162 lines (126 loc) · 4.37 KB

test1.md

File metadata and controls

162 lines (126 loc) · 4.37 KB

""" Django settings for buetpx_back project.

Generated by 'django-admin startproject' using Django 4.0.5.

For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/

For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """

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

SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'django-insecure-9(lrarc7mt+cwh2&$gx+l4eoi11g5+8m-hs3qo)r^)g$!h6jg4'

SECURITY WARNING: don't run with debug turned on in production!

DEBUG = True

ALLOWED_HOSTS = []

Application definition

INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'buetpx.apps.BuetpxConfig', 'post.apps.PostConfig', 'corsheaders', 'signup_login.apps.SignupLoginConfig', 'gallery.apps.GalleryConfig', 'rest_framework.authtoken', ] REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', 'PAGE_SIZE': 10, 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.TokenAuthentication', ), 'DEFAULT_PERMISSION_CLASSES':( 'rest_framework.permissions.IsAuthenticated', ), }

python manage.py makemigrations

MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', #Cors 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', ]

CORS_ORIGIN_ALLOW_ALL = True CORS_ORIGIN_WHITELIST = ( 'http://localhost:8081', 'http://localhost:3000', )

ROOT_URLCONF = 'buetpx_back.urls'

TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ]

WSGI_APPLICATION = 'buetpx_back.wsgi.application'

Database

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'buetpxdb2', 'USER': 'postgres', 'PASSWORD': '1234', 'HOST': '127.0.0.1', 'PORT': '5432', } }

PASSWORD_HASHERS = [ # 'django.contrib.auth.hashers.Brest_frameworkCryptSHA256PasswordHasher', 'django.contrib.auth.hashers.PBKDF2PasswordHasher', 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher', 'django.contrib.auth.hashers.Argon2PasswordHasher', 'django.contrib.auth.hashers.ScryptPasswordHasher', ]

Password validation

AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ]

Internationalization

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True

Static files (CSS, JavaScript, Images)

STATIC_URL = 'static/'

Default primary key field type

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'