From 365269edc38f92ee90b280b1bd5c9fb49789ae8e Mon Sep 17 00:00:00 2001 From: Tom JEANNESSON Date: Wed, 21 Feb 2024 15:26:42 +0100 Subject: [PATCH] fix(speed): replaced api key package version, 10x speed increase --- Makefile | 14 ++++++++++++++ backend/.envs/.dev_as_prod/.django | 2 +- backend/requirements/base.txt | 16 ++++++++-------- backend/requirements/development.txt | 1 + setup-osx.sh | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 9fbb2dd..c700090 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,20 @@ up: up-prod: docker compose -f backend/docker/production.yml up -d --build --remove-orphans +up-no-docker: + export DB_SETUP=litestream + export DB_ENGINE=SQLITE + export USE_DOCKER=no + export IPYTHONDIR=/app/.ipython + export REDIS_URL=redis://redis:6379/0 + export DJANGO_SETTINGS_MODULE=config.settings.development + export DJANGO_SECRET_KEY=not_so_secret + export DJANGO_DEBUG=True + export IS_LOCAL=True + python backend/manage.py makemigrations + python backend/manage.py migrate + python backend/manage.py runserver_plus + down: docker compose -f backend/docker/development-${IMAGE}.yml down diff --git a/backend/.envs/.dev_as_prod/.django b/backend/.envs/.dev_as_prod/.django index ce09b8c..eea5ecd 100644 --- a/backend/.envs/.dev_as_prod/.django +++ b/backend/.envs/.dev_as_prod/.django @@ -17,4 +17,4 @@ IS_LOCAL=True # Flower # ------------------------------------------------------------------------------ CELERY_FLOWER_USER= -CELERY_FLOWER_PASSWORD= \ No newline at end of file +CELERY_FLOWER_PASSWORD= diff --git a/backend/requirements/base.txt b/backend/requirements/base.txt index 4896f58..38c426a 100644 --- a/backend/requirements/base.txt +++ b/backend/requirements/base.txt @@ -9,19 +9,19 @@ redis==5.0.1 # https://github.com/redis/redis-py celery==5.3.6 # pyup: < 6.0 # https://github.com/celery/celery flower==2.0.1 # https://github.com/mher/flower -# Django -# ------------------------------------------------------------------------------ +# # Django +# # ------------------------------------------------------------------------------ django==4.2.7 # https://www.djangoproject.com/ -djangorestframework-simplejwt==5.3.0 # https://github.com/jazzband/djangorestframework-simplejwt -django-health-check==3.17.0 # https://github.com/revsys/django-health-check django-environ==0.11.2 # https://github.com/joke2k/django-environ django-celery-beat==2.5.0 # https://github.com/celery/django-celery-beat -django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions drf-spectacular==0.26.5 # https://github.com/tfranzel/drf-spectacular +django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions django-cors-headers==4.3.1 # https://github.com/adamchainz/django-cors-headers +djangorestframework-simplejwt==5.3.0 # https://github.com/jazzband/djangorestframework-simplejwt +django-health-check==3.17.0 # https://github.com/revsys/django-health-check -django-napse==1.10.4 # https://github.com/napse-invest/django-napse -djangorestframework-api-key==2.3.0 +django-napse==1.11.0 # https://github.com/napse-invest/django-napse +djangorestframework-api-key==3.0.0 -# External tools +# # External tools boto3==1.34.14 # https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html diff --git a/backend/requirements/development.txt b/backend/requirements/development.txt index 59fd2d9..55c8a05 100644 --- a/backend/requirements/development.txt +++ b/backend/requirements/development.txt @@ -3,6 +3,7 @@ Werkzeug==3.0.1 # https://github.com/pallets/werkzeug ipdb==0.13.13 # https://github.com/gotcha/ipdb watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles +tblib==3.0.0 # https://pypi.org/project/tblib/ # Testing # ------------------------------------------------------------------------------ diff --git a/setup-osx.sh b/setup-osx.sh index 96c8c07..e8438d3 100755 --- a/setup-osx.sh +++ b/setup-osx.sh @@ -1,5 +1,5 @@ brew install python@3.11 -python3.11 -m pip install --upgrade pip +# python3.11 -m pip install --upgrade pip pip3 install virtualenv python3 -m virtualenv .venv --python=python3.11 printf "\n===============================================\nVirtual python environment has been created.\n"