Skip to content

guides: add django#24851

Merged
craig-osterhout merged 8 commits intodocker:mainfrom
craig-osterhout:django-guide
Apr 23, 2026
Merged

guides: add django#24851
craig-osterhout merged 8 commits intodocker:mainfrom
craig-osterhout:django-guide

Conversation

@craig-osterhout
Copy link
Copy Markdown
Contributor

@craig-osterhout craig-osterhout commented Apr 21, 2026

Description

Added simple Django guide.

https://deploy-preview-24851--docsdocker.netlify.app/guides/django/

Related issues or tickets

Closes #21277

Reviews

  • Editorial review

Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 4cbdcc1
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/69ea85ab694c66000916afa1
😎 Deploy Preview https://deploy-preview-24851--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
@craig-osterhout
Copy link
Copy Markdown
Contributor Author

/review

Copy link
Copy Markdown
Contributor

@docker-agent docker-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🔴 CRITICAL

This PR adds a new Django guide to Docker docs. The guide is well-structured and covers a useful topic, but has several issues that need attention before merge:

  • 1 HIGH finding: A Compose environment variable (DEBUG=1) is set but settings.py is never shown reading it from the environment, so it silently has no effect.
  • 3 MEDIUM findings: Non-standard callout syntax, a broken ordered-list code block (missing indentation), and a factually incorrect YAML comment about Django's DEBUG setting and auto-reload.
  • 1 MEDIUM finding: Marketing language ("simplify compliance") in the DHI section.

Comment thread content/guides/django.md Outdated
Comment thread content/guides/django.md Outdated
Comment thread content/guides/django.md Outdated
Comment thread content/guides/django.md Outdated
Comment thread content/guides/django.md
Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
@craig-osterhout craig-osterhout requested a review from a team April 22, 2026 19:30
@craig-osterhout craig-osterhout added the status/review Pull requests that are ready for review label Apr 22, 2026
@craig-osterhout craig-osterhout marked this pull request as ready for review April 22, 2026 19:30
Comment thread content/guides/django.md Outdated
Comment thread content/guides/django.md Outdated
Comment thread content/guides/django.md
Comment thread content/guides/django.md Outdated
Comment thread content/guides/django.md Outdated
Comment thread content/guides/django.md Outdated
Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
@craig-osterhout
Copy link
Copy Markdown
Contributor Author

craig-osterhout commented Apr 23, 2026

  • Replaced docker init and Docker Official Images with Docker Hardened Images (DHI) throughout. The guide now uses DHI for both the Python app and PostgreSQL service.
  • Switched from pip/requirements.txt to uv/pyproject.toml. All dependency management — bootstrapping, adding packages, and installing in the Dockerfile — now uses uv.
  • Added two bootstrapping options. Users can scaffold the project with a local uv installation or entirely via a DHI dev container, with no local Python required.
  • Updated PostgreSQL from postgres:17 (DOI) to dhi.io/postgres:18. Removed the user: postgres override since DHI postgres already runs as nonroot. Updated the volume mount path to /var/lib/postgresql to match DHI's data directory layout.
  • Updated Alpine from 3.21 to 3.22.
  • Updated Compose Watch triggers from requirements.txt to pyproject.toml and uv.lock.
  • Added UV_LINK_MODE=copy to the Dockerfile builder stage and container bootstrap commands to suppress a hardlink warning that appears when the uv cache and build filesystem are on separate volumes.
  • Fixed the project directory tree to reflect that uv now generates main.py instead of hello.py.
  • Added a note on Windows shell syntax for the container bootstrap commands.

@craig-osterhout craig-osterhout requested a review from dvdksn April 23, 2026 17:19
Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
@craig-osterhout
Copy link
Copy Markdown
Contributor Author

/review

Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
Copy link
Copy Markdown
Contributor

@docker-agent docker-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

Two medium-severity issues found in the new Django guide that could mislead users copying example code.

Comment thread content/guides/django.md
Comment thread content/guides/django.md
Comment thread content/guides/django.md Outdated
Comment thread content/guides/django.md Outdated
Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
@craig-osterhout craig-osterhout merged commit 3586ba5 into docker:main Apr 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/guides status/review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python/Django guide

2 participants