Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
47a8423
update python, django and minor packages
Cybernetic-Ransomware May 24, 2026
cc84a7c
dockerized
Cybernetic-Ransomware May 24, 2026
5dceb86
refactor(toolchain): swap lint stack to ruff, codespell and bandit
Cybernetic-Ransomware May 24, 2026
90670ec
refactor(tests): migrate test runner to pytest with markers
Cybernetic-Ransomware May 24, 2026
70655b5
chore(toolchain): add justfile with dev task recipes
Cybernetic-Ransomware May 24, 2026
9be91b8
refactor(settings): migrate STATICFILES_STORAGE to STORAGES for Djang…
Cybernetic-Ransomware May 24, 2026
33c4a01
docs(readme): update stack references from Pipenv to uv and pytest
Cybernetic-Ransomware May 24, 2026
7f80bfd
chore(infra): align PostgreSQL image to 18-alpine across docker-compo…
Cybernetic-Ransomware May 24, 2026
8be4f60
refactor(settings): skip CouchDB init for offline manage.py commands
Cybernetic-Ransomware May 24, 2026
079c397
refactor(celery): replace django-crontab with Celery Beat for discord…
Cybernetic-Ransomware May 24, 2026
eddbbf8
feat(django): bump to 6.0.5 and register django.contrib.postgres for …
Cybernetic-Ransomware May 24, 2026
3971293
feat(django6): add CSP middleware, Template Partials, and Background …
Cybernetic-Ransomware May 24, 2026
a2d124b
test(homepage): add CSP header tests and fix static manifest in CI
Cybernetic-Ransomware May 24, 2026
37b4e9d
refactor(layout): hoist tooling files from AHC_app/ to repo root
Cybernetic-Ransomware May 24, 2026
68be5d7
refactor(docker): move Docker files to docker/ and update build contexts
Cybernetic-Ransomware May 24, 2026
a5dbae2
refactor(layout): move Django project package to src/ahc/
Cybernetic-Ransomware May 24, 2026
199006b
refactor(celery): move celery_notifications to src/celery_notifications/
Cybernetic-Ransomware May 29, 2026
1d2267c
refactor(layout): move Django apps to src/ahc/apps/
Cybernetic-Ransomware May 29, 2026
3f15c97
docs(layout): finalize src-layout refactor documentation
Cybernetic-Ransomware May 30, 2026
d931792
feat(security): remove hardcoded SECRET_KEY and DEBUG from settings
Cybernetic-Ransomware May 30, 2026
d5b212b
fix(cd): rename hook alias
Cybernetic-Ransomware May 30, 2026
0332817
chore(toolchain): rename ruff hook, add just help
Cybernetic-Ransomware May 30, 2026
4cfa477
refactor(homepage): drop orphaned CronJob model
Cybernetic-Ransomware May 30, 2026
715031b
test(apps): add tests for animals, users, medical_notes; fix signal b…
Cybernetic-Ransomware May 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions AHC_app/.env.template → .env.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Django core
SECRET_KEY=
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1

# PostgresDB for docker-compose.yml - dev
POSTGRES_DB=
POSTGRES_USER=
Expand Down
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Auto detect text files and perform LF normalization
* text=auto

# Vendor static files — preserve LF line endings as published
static/**/* text eol=lf
static_collected/**/* text eol=lf
57 changes: 16 additions & 41 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
Expand All @@ -34,51 +34,26 @@ jobs:
EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
PYTHONUNBUFFERED: "1"
PYTHONPATH: "/home/runner/work/Animals_Healthcare_Application/Animals_Healthcare_Application/AHC_app"
# strategy:
# max-parallel: 4

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v3
with:
python-version: 3.12

- name: Install PostgreSQL dependencies
run: sudo apt-get install -y libpq-dev

- name: Install pipenv
run: pip install pipenv

- name: Prepare environment
run: |
cd ./AHC_app
pipenv install --dev
pipenv graph
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: "3.14"

- name: Show Python version
run: python --version
working-directory: ./AHC_app
- name: Install dependencies
run: uv sync

- name: Show pip version
run: pip --version
working-directory: ./AHC_app
- name: Run tests (Django runner)
run: PYTHONPATH=src uv run python manage.py test

- name: Show pipenv version
run: pipenv --version
working-directory: ./AHC_app

- name: List installed packages
run: pipenv run pip list
working-directory: ./AHC_app

- name: Prepare environment and run tests
run: |
PYTHONPATH=$(pwd) pipenv run python manage.py test
working-directory: ./AHC_app
- name: Run tests (pytest)
run: uv run pytest -m "not slow"

build-and-push:
name: Build and Push to ECR
Expand All @@ -87,7 +62,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -106,8 +81,8 @@ jobs:
ECR_URI: ${{ secrets.ECR_URI_APPENDIXES_DB }}
IMAGE_TAG: latest
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker build -t $ECR_URI:$IMAGE_TAG .
docker push $ECR_URI:$IMAGE_TAG

- name: Build, tag and push the celery-flower image to ECR
id: build-image-celery-flower
Expand Down
162 changes: 30 additions & 132 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,165 +1,63 @@
# Byte-compiled / optimized / DLL files
# Python
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
*.egg-info/
.Python

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
# Testing
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
htmlcov/
.pytest_cache/
cover/

# Translations
*.mo
*.pot
.hypothesis/

# Django stuff:
# Django
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
.venv/
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject
# uv — commit uv.lock, do NOT add it here
# .python-version is intentionally tracked

# Rope project settings
.ropeproject
# Build / packaging
build/
dist/
wheels/

# mkdocs documentation
/site
# Celery
celerybeat-schedule
celerybeat.pid

# mypy
# Type checkers
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/
.ty_cache/

# Cython debug symbols
cython_debug/
# Claude Code — not tracked in this repository
.claude/
CLAUDE.md

# PyCharm
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
# IDE
.idea/

# Collected static files - temporary
/AHC_app/static_collected/
/AHC_app/static/media/profile_pics/animals/
/AHC_app/static/media/attachments/
# Project-specific
/static_collected/
/static/media/profile_pics/animals/
/static/media/attachments/

# Kubernetes configuration
/AHC_app/tars/
# Kubernetes
/tars/
/kubernetes/**/*.tar
secret.yaml

# volumens
# Volumes
/db/
41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
exclude: 'static/|static_collected/'

repos:
- repo: local
hooks:
- id: uv-lock-check
name: uv lock --check
entry: uv lock --check
language: system
pass_filenames: false
files: ^pyproject\.toml$

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
exclude: '\.sh$'
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.14
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format

- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
types_or: [python, markdown, yaml]

- repo: local
hooks:
- id: bandit
name: bandit
entry: bandit -r src -c pyproject.toml -q
language: python
additional_dependencies: ["bandit[toml]==1.9.4"]
pass_filenames: false
always_run: true
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
2 changes: 0 additions & 2 deletions AHC_app/.dockerignore

This file was deleted.

29 changes: 0 additions & 29 deletions AHC_app/.pre-commit-config.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions AHC_app/Dockerfile-queue

This file was deleted.

Loading
Loading