Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/django-app/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
*.pyc
**/__pycache__

# allows installing pipenv dependencies locally in a virtual environment
# allows installing uv dependencies locally in a virtual environment
.venv
15 changes: 8 additions & 7 deletions packages/django-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM python:3.11-slim as base
ENV PYTHONUNBUFFERED 1
FROM python:3.13-slim as base
ENV PYTHONUNBUFFERED=1
ENV UV_PROJECT_ENVIRONMENT="/usr/local"

# install pipenv and compilation dependencies
# install uv and compilation dependencies
# https://cryptography.io/en/latest/installation/
RUN apt-get update && apt-get install -y build-essential libssl-dev libffi-dev python3-dev cargo
RUN pip install --upgrade pip pipenv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# install python dependencies
RUN mkdir /code
WORKDIR /code
COPY Pipfile /code
COPY Pipfile.lock /code
RUN pipenv install --dev --deploy --system
COPY pyproject.toml /code
COPY uv.lock /code
RUN uv sync --frozen

# install application into container
COPY . /code
Expand Down
29 changes: 0 additions & 29 deletions packages/django-app/Pipfile

This file was deleted.

1,046 changes: 0 additions & 1,046 deletions packages/django-app/Pipfile.lock

This file was deleted.

2 changes: 0 additions & 2 deletions packages/django-app/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

name: brainspread

volumes:
Expand Down
26 changes: 16 additions & 10 deletions packages/django-app/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,29 @@ django-admin *ARGS="":
exec +ARGS:
docker-compose exec web {{ARGS}}

# Install pipenv package (dev or prod)
# Install uv package (dev or prod)
install-package PACKAGE DEV="":
#!/usr/bin/env bash
set -euo pipefail

if [ "{{DEV}}" = "--dev" ]; then
echo "Installing {{PACKAGE}} as dev dependency..."
pipenv install --dev {{PACKAGE}}
uv add --dev {{PACKAGE}}
else
echo "Installing {{PACKAGE}} as production dependency..."
pipenv install {{PACKAGE}}
uv add {{PACKAGE}}
fi

echo "Rebuilding containers with new dependencies..."
docker-compose build web

# Install dev package shorthand
install-dev PACKAGE:
just install-package {{PACKAGE}} --dev

# Update pipenv dependencies
# Update uv dependencies
update-deps:
pipenv update
uv lock --upgrade
docker-compose build web

# Generate Django secret key
Expand Down Expand Up @@ -248,9 +248,7 @@ dcp-cleanup:

# Setup local Python virtual environment
setup-local-python-venv:
python3 -m venv .venv
source .venv/bin/activate
PIPENV_VENV_IN_PROJECT=1 pipenv install --dev --deploy
uv sync

# Copy environment template file
copy-env:
Expand Down Expand Up @@ -369,6 +367,14 @@ prepush:

alias p := prepush

# Update production - pull, build, migrate, restart
update:
git pull origin main
docker-compose build web
just migrate
docker-compose stop web
docker-compose -f docker-compose.yml up -d web

# AI Tools
# start playwright mcp server
ai-start-playwright-mcp:
Expand Down
4 changes: 2 additions & 2 deletions packages/django-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions packages/django-app/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[project]
name = "brainspread"
version = "0.1.0"
description = "Django app for brainspread"
requires-python = "==3.13.*"
dependencies = [
"django==5.0.2",
"django-extensions==3.2.3",
"psycopg[binary]==3.2.3",
"typing-extensions==4.14.0",
"stringcase==1.2.0",
"djangorestframework==3.14.0",
"django-cors-headers==4.3.1",
"anthropic==0.55.0",
"httpx>=0.24.0,<0.28.0",
"openai",
"google-generativeai",
]

[dependency-groups]
dev = [
"pytest==8.0.0",
"pytest-cov==4.1.0",
"pytest-django==4.8.0",
"factory-boy==3.3.0",
"black==25.1.0",
"pytest-mock==3.14.1",
"ruff==0.12.0",
]

[tool.black]
line-length = 88
target-version = ['py313']
exclude = '''
/(
\.git
| \.venv
| migrations
| __pycache__
)/
'''

[tool.ruff]
exclude = [
".git",
".venv",
"__pycache__",
"migrations",
]
line-length = 88

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "app.test_settings"
python_files = ["tests.py", "test_*.py", "*_test.py", "*_tests.py"]
addopts = "--reuse-db"
markers = [
"integration: marks tests as integration tests (deselect with '-m \"not integration\"')",
]
12 changes: 0 additions & 12 deletions packages/django-app/pytest.ini

This file was deleted.

Loading