Skip to content

Commit

Permalink
Merge pull request #466 from Hexlet/sql-rework
Browse files Browse the repository at this point in the history
rework fetchdata to fix n+1 queries
  • Loading branch information
sgmdlt authored Oct 15, 2024
2 parents 0d632a9 + 470eb93 commit d61ae0d
Show file tree
Hide file tree
Showing 9 changed files with 596 additions and 443 deletions.
11 changes: 5 additions & 6 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_DISABLE_PIP_VERSION_CHECK=on \
POETRY_VERSION=1.2.2 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
Expand All @@ -14,8 +13,8 @@ WORKDIR /usr/local/src/hexlet-friends

COPY pyproject.toml poetry.lock ./

RUN apt-get update \
&& apt-get install -y curl make git \
&& curl -sSL https://install.python-poetry.org | python3 - && poetry --version \
&& git config --global --add safe.directory `pwd` \
&& poetry install --extras psycopg2-binary
RUN apt-get update && \
apt-get install -y --no-install-recommends curl make git && \
pip install --no-cache-dir poetry && poetry --version && \
git config --global --add safe.directory "$(pwd)" && \
poetry install --extras psycopg2-binary
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ secretkey:

setup: install
$(MAKE) migrate
poetry run python manage.py createsuperuser --noinput --username admin --email [email protected]
$(MAKE) updatesuperuser

updatesuperuser:
poetry run python manage.py updatesuperuser --username admin --email [email protected]

shell:
poetry run python manage.py shell_plus --plain
Expand Down
Loading

0 comments on commit d61ae0d

Please sign in to comment.