diff --git a/docker-compose.yml b/docker-compose.yml index 8c78946..b1b42b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,15 +29,12 @@ services: command: > sh -c "python manage.py migrate && python manage.py collectstatic --noinput && - python manage.py loaddata fixtures/groups.json + python manage.py loaddata fixtures/groups.json && python manage.py runserver 0.0.0.0:${DJANGO_PORT}" environment: <<: *postgres-variables <<: *django-variables <<: *frontend-variables - volumes: - - ./django_static/:/code/django_static/ - - ./media/:/code/media/ ports: - "${DJANGO_PORT}:${DJANGO_PORT}" expose: diff --git a/postamates/settings.py b/postamates/settings.py index 9909a59..79695fb 100644 --- a/postamates/settings.py +++ b/postamates/settings.py @@ -139,8 +139,8 @@ CORS_ORIGIN_ALLOW = True # DB_URL = 'postgresql://postamates_user:postamates_pass@postamates.spatiality.website:5481/postamates_db' DB_URL = f"postgresql://{os.getenv('POSTGRES_USER', 'postgres')}:" \ - f"{os.getenv('POSTGRES_PASSWORD', 'postgres')}@{os.getenv('POSTGRES_HOST', 'postgres')}:" \ - f"{os.getenv('POSTGRES_PORT', 'postgres')}/{os.getenv('POSTGRES_DB', 'postgres')}" + f"{os.getenv('POSTGRES_PASSWORD', 'postgres')}@{os.getenv('POSTGRES_HOST', '127.0.0.1')}:" \ + f"{os.getenv('POSTGRES_PORT', 5432)}/{os.getenv('POSTGRES_DB', 'postgres')}" if os.getenv('local') is not None: GDAL_LIBRARY_PATH = '/opt/homebrew/opt/gdal/lib/libgdal.dylib' GEOS_LIBRARY_PATH = '/opt/homebrew/opt/geos/lib/libgeos_c.dylib' diff --git a/service/management/commands/test_ml.py b/service/management/commands/test_ml.py new file mode 100644 index 0000000..a03e650 --- /dev/null +++ b/service/management/commands/test_ml.py @@ -0,0 +1,10 @@ +from django.core.management.base import BaseCommand +from django.utils import timezone +from service.tasks import raschet + + +class Command(BaseCommand): + help = 'Test ML function' + + def handle(self, *args, **kwargs): + raschet()