Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JusticeV452 committed Jun 27, 2024
1 parent 5f6cf67 commit 83339a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
3 changes: 2 additions & 1 deletion backend/app/management/commands/compile_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def translate(fro, to, src_dir, dest_dir, fuzzy=False):
# due to conflict with Django BaseCommand parser
class Arguments:
def __init__(self, **kwargs):
[setattr(self, attr, val) for attr, val in kwargs.items()]
for attr, val in kwargs.items():
setattr(self, attr, val)

arguments = Arguments(fro=fro, to=to, src=src_dir, dest=dest_dir)

Expand Down
1 change: 0 additions & 1 deletion backend/app/management/commands/runanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,3 @@ def handle(self, *args, **options):
photos_done += 1
if photos_done % 25 == 0:
print(f'\nAnalyzed {photos_done} so far...')

30 changes: 18 additions & 12 deletions backend/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
CONFIG_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BACKEND_DIR = os.path.dirname(CONFIG_DIR)
PROJECT_ROOT = os.path.dirname(BACKEND_DIR)
MIGRATIONS_DIR = os.path.join(os.path.dirname(CONFIG_DIR), 'app/migrations')
MIGRATIONS_DIR = os.path.join(os.path.dirname(CONFIG_DIR), 'app', 'migrations')
SETTINGS_DIR = os.path.join(CONFIG_DIR, 'settings')

BACKEND_DATA_DIR = os.path.join(BACKEND_DIR, 'data')
Expand Down Expand Up @@ -46,6 +46,7 @@
# We used to use this directory as a fallback in development for _showing_ images
# as well, but we no longer do this: all image display is via the S3 bucket.
LOCAL_PHOTOS_DIR = None
LOCAL_DB_PATH = os.path.join(BACKEND_DIR, 'db.sqlite3')

BLOG_ROOT_URL = "articles"

Expand Down Expand Up @@ -128,19 +129,24 @@

# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
db_config = {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': LOCAL_DB_PATH,
}
pw_path = Path(PROJECT_ROOT, 'db_password.txt')
with open(pw_path, 'r', encoding='utf-8') as pw_file:
db_pw = pw_file.readline().strip()

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'HOST': 'paris1970-urop-fa22.crdpmszp71qh.us-east-1.rds.amazonaws.com',
'USER': 'urop',
'NAME': 'paris1970-urop-fa22',
'PORT': '5432',
'PASSWORD': db_pw,
if os.path.exists(pw_path):
with open(pw_path, 'r', encoding='utf-8') as pw_file:
db_pw = pw_file.readline().strip()
db_config = {
'ENGINE': 'django.db.backends.postgresql',
'HOST': 'paris1970-urop-fa22.crdpmszp71qh.us-east-1.rds.amazonaws.com',
'USER': 'urop',
'NAME': 'paris1970-urop-fa22',
'PORT': '5432',
'PASSWORD': db_pw,
}
DATABASES = {
'default': db_config
}


Expand Down

0 comments on commit 83339a2

Please sign in to comment.