From 5c0d8583b02b58cdef11f91ddc15dd2ee366698a Mon Sep 17 00:00:00 2001 From: Ivan Filippov Date: Thu, 14 Dec 2023 16:58:38 +0500 Subject: [PATCH] Moved constants to settings.py --- .../adaptive_hockey_federation/settings.py | 3 +++ .../core/management/commands/fill-db.py | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/adaptive_hockey_federation/adaptive_hockey_federation/settings.py b/adaptive_hockey_federation/adaptive_hockey_federation/settings.py index c79871cf..06ac2a18 100644 --- a/adaptive_hockey_federation/adaptive_hockey_federation/settings.py +++ b/adaptive_hockey_federation/adaptive_hockey_federation/settings.py @@ -89,5 +89,8 @@ MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') +RESOURSES_ROOT = os.path.join(BASE_DIR, 'resourses') +PARSER_MAIN = os.path.join(BASE_DIR, 'parser/parser.py') + DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' AUTH_USER_MODEL = 'users.User' diff --git a/adaptive_hockey_federation/core/management/commands/fill-db.py b/adaptive_hockey_federation/core/management/commands/fill-db.py index fddd1f01..fd154fb8 100644 --- a/adaptive_hockey_federation/core/management/commands/fill-db.py +++ b/adaptive_hockey_federation/core/management/commands/fill-db.py @@ -1,16 +1,12 @@ -import os import subprocess from django.core.management.base import BaseCommand -from adaptive_hockey_federation.settings import BASE_DIR - -RESOURSES_ROOT = os.path.join(BASE_DIR, 'resourses') -PARSER_MAIN = os.path.join(BASE_DIR, 'parser/parser.py') +from adaptive_hockey_federation.settings import PARSER_MAIN, RESOURSES_ROOT class Command(BaseCommand): - help = "Описание команды" + help = "Запуск парсера офисных документов." def handle(self, *args, **options): run_parser = subprocess.getoutput(