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