From 207d56dc710c6c1bc27d18bc083476e289d77e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Porto?= Date: Sat, 23 Sep 2023 02:49:41 -0300 Subject: [PATCH] trying database settings --- sara/settings.py | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/sara/settings.py b/sara/settings.py index 2841115..771fd82 100644 --- a/sara/settings.py +++ b/sara/settings.py @@ -9,17 +9,14 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.1/ref/settings/ """ - +import os from pathlib import Path import configparser -import os from django.utils.translation import gettext_lazy as _ # SECURITY WARNING: keep the secret key used in production secret! -# SECURITY WARNING: don't run with debug turned on in production! from .settings_local import * - # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -82,25 +79,30 @@ # Database # https://docs.djangoproject.com/en/4.1/ref/settings/#databases - -HOME = os.environ.get('HOME') -replica_path = HOME + '/replica.my.cnf' -if os.path.exists(replica_path): - config = configparser.ConfigParser() - config.read(replica_path) -else: - print('replica.my.cnf file not found') - DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.mysql', - 'NAME': 's55346__saradb', - 'USER': config['client']['user'], - 'PASSWORD': config['client']['password'], - 'HOST': 'tools.db.svc.wikimedia.cloud', - 'PORT': '', + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', } } +# HOME = os.environ.get('HOME') +# replica_path = HOME + '/replica.my.cnf' +# if os.path.exists(replica_path): +# config = configparser.ConfigParser() +# config.read(replica_path) +# else: +# print('replica.my.cnf file not found') +# +# DATABASES = { +# 'default': { +# 'ENGINE': 'django.db.backends.mysql', +# 'NAME': 's55346__saradb', +# 'USER': config['client']['user'], +# 'PASSWORD': config['client']['password'], +# 'HOST': 'tools.db.svc.wikimedia.cloud', +# 'PORT': '', +# } +# } # Password validation # https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators @@ -144,10 +146,9 @@ # https://docs.djangoproject.com/en/4.1/howto/static-files/ STATIC_URL = 'static/' -# STATICFILES_DIRS = ( -# os.path.join(BASE_DIR, 'static'), -# ) +# STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static')) STATIC_ROOT = os.path.join(BASE_DIR, 'static') + # Default primary key field type # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field