This commit is contained in:
anhduy-tech
2026-03-06 09:51:53 +07:00
parent 39aea8784e
commit 3ece124848
487 changed files with 1851 additions and 108460 deletions

View File

@@ -21,7 +21,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-_u202k$8qq2p*cr_eo(7k!0ngr5^n)27@85+5oy8&41(u6&j54'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG = True
ALLOWED_HOSTS = ['*']
@@ -42,13 +42,11 @@ INSTALLED_APPS = [
]
MIDDLEWARE = [
# 'app.middleware.BlockUnauthorizedOriginsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'app.middleware.CurrentUserMiddleware', # Add CurrentUserMiddleware
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'corsheaders.middleware.CorsMiddleware'
@@ -81,15 +79,15 @@ ASGI_APPLICATION = 'api.asgi.application'
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
#prod:5.223.52.193 dev:5.223.42.146
MODE = 'prod'
DBHOST = '172.17.0.1' if MODE == 'prod' else '5.223.42.146'
MODE = 'dev'
DBHOST = '138.199.203.34' if MODE == 'prod' else '138.199.203.34'
DATABASES = {
'default': {
'ENGINE': 'django_db_geventpool.backends.postgresql_psycopg3', # Hoặc psycopg3/postgis
'NAME': 'utopia',
'NAME': 'erp_db',
'USER': 'postgres',
'PASSWORD': 'W7VVBUnqDRy7OVkWfdTB4fS0HQ1615',
'PASSWORD': '0q6XiMhNuHOQM1cBOQUu9NWkVeT8dz',
'HOST': DBHOST,
'PORT': '5423',
'CONN_MAX_AGE': 0, # Tắt persistent connection mặc định của Django