# python/pythondotorg architecture

> Architecture diagram of the GitHub repository python/pythondotorg, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/python/pythondotorg
- Repository: https://github.com/python/pythondotorg

## Overview

This repository is the Django application behind python.org. Visitors browse published pages and community content, find downloads, events and jobs, and interact with account-based services; staff and sponsors also manage sponsorships and agreements. The tree indicates these distinct product areas, but their detailed request flow was not sampled, so those links are shown as unverified. The sourced relationships show startup registration for agreement kinds and signal listeners, plus sponsorship benefit/model dependencies. The README identifies Django, PostgreSQL, Redis and Celery, but does not document specific runtime integrations.

Main entry points: [`pydotorg/urls.py`](https://github.com/python/pythondotorg/blob/main/pydotorg/urls.py) (Python.org site), [`apps/agreements/kinds.py`](https://github.com/python/pythondotorg/blob/main/apps/agreements/kinds.py) (Agreement kinds), [`apps/users/models.py`](https://github.com/python/pythondotorg/blob/main/apps/users/models.py) (User accounts), [`apps/sponsors/views.py`](https://github.com/python/pythondotorg/blob/main/apps/sponsors/views.py) (Sponsor management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Site and content"]
  node_site["Python.org site<br/>[urls.py]"]
  node_pages["Pages<br/>[views.py]"]
  node_blogs["Blogs<br/>[views.py]"]
  node_cms["CMS<br/>[views.py]"]
  node_banners["Banners<br/>[models.py]"]
end

subgraph group_discovery["Community services"]
  node_downloads["Downloads<br/>[views.py]"]
  node_events["Events<br/>[views.py]"]
  node_jobs["Job board<br/>[views.py]"]
  node_community["Community<br/>[views.py]"]
  node_job_notifications["Job notifications<br/>[listeners.py]"]
  node_job_signals["Job signals<br/>[signals.py]"]
end

subgraph group_agreements["Agreements"]
  node_agreements_workflow["Agreement workflow<br/>[workflow.py]"]
  node_agreement_kinds["Agreement kinds<br/>[kinds.py]"]
  node_order_kinds["Order kinds<br/>[kinds.py]"]
  node_agreement_registry["Kind registry<br/>[registry.py]"]
  node_agreement_docs["Document composition<br/>[documents.py]"]
  node_order_docs["Order documents<br/>[documents.py]"]
end

subgraph group_sponsorship["Sponsorship"]
  node_sponsor_views["Sponsor management<br/>[views.py]"]
  node_sponsor_models[("Sponsor records<br/>[sponsors.py]")]
  node_sponsorship_models[("Programs and benefits<br/>[sponsorship.py]")]
  node_benefit_features[("Benefit features<br/>[benefits.py]")]
  node_sponsor_assets[("Sponsor assets<br/>[assets.py]")]
  node_benefit_queries["Benefit queries<br/>[managers.py]"]
end

subgraph group_platform["Application core"]
  node_accounts[("User accounts<br/>[models.py]")]
  node_user_listeners["Account listeners<br/>[listeners.py]"]
  node_core_signals["Core signals<br/>[signals.py]"]
end

node_visitor(("Site visitor"))
node_staff(("Staff user"))
node_sponsor(("Sponsor"))
node_postgres[("PostgreSQL")]
node_email["Email service"]

node_visitor -.->|"browses"| node_site
node_staff -.->|"manages"| node_site
node_sponsor -.->|"manages benefits"| node_sponsor_views
node_site -.->|"routes to"| node_pages
node_site -.->|"routes to"| node_blogs
node_site -.->|"routes to"| node_cms
node_site -.->|"renders"| node_banners
node_site -.->|"routes to"| node_downloads
node_site -.->|"routes to"| node_events
node_site -.->|"routes to"| node_jobs
node_site -.->|"routes to"| node_community
node_site -.->|"routes to"| node_agreements_workflow
node_site -.->|"routes to"| node_sponsor_views
node_accounts -.->|"persists in"| node_postgres
node_agreements_workflow -.->|"uses"| node_agreement_kinds
node_agreement_kinds -->|"registers with"| node_agreement_registry
node_agreement_kinds -->|"composes with"| node_agreement_docs
node_order_kinds -->|"registers with"| node_agreement_registry
node_order_kinds -->|"composes with"| node_order_docs
node_sponsor_views -.->|"manages"| node_sponsor_models
node_sponsor_models -.->|"relates to"| node_sponsorship_models
node_sponsorship_models -.->|"configures"| node_benefit_features
node_benefit_features -->|"uses"| node_sponsor_assets
node_benefit_queries -->|"queries"| node_benefit_features
node_jobs -.->|"emits events"| node_job_signals
node_job_signals -->|"dispatches"| node_job_notifications
node_job_notifications -->|"sends mail"| node_email
node_accounts -->|"triggers save"| node_user_listeners
node_user_listeners -->|"creates token"| node_accounts
node_core_signals -.->|"supports application"| node_site

click node_site "https://github.com/python/pythondotorg/blob/main/pydotorg/urls.py"
click node_pages "https://github.com/python/pythondotorg/blob/main/apps/pages/views.py"
click node_blogs "https://github.com/python/pythondotorg/blob/main/apps/blogs/views.py"
click node_cms "https://github.com/python/pythondotorg/blob/main/apps/cms/views.py"
click node_banners "https://github.com/python/pythondotorg/blob/main/apps/banners/models.py"
click node_downloads "https://github.com/python/pythondotorg/blob/main/apps/downloads/views.py"
click node_events "https://github.com/python/pythondotorg/blob/main/apps/events/views.py"
click node_jobs "https://github.com/python/pythondotorg/blob/main/apps/jobs/views.py"
click node_community "https://github.com/python/pythondotorg/blob/main/apps/community/views.py"
click node_accounts "https://github.com/python/pythondotorg/blob/main/apps/users/models.py"
click node_agreements_workflow "https://github.com/python/pythondotorg/blob/main/apps/agreements/workflow.py"
click node_agreement_kinds "https://github.com/python/pythondotorg/blob/main/apps/agreements/kinds.py"
click node_order_kinds "https://github.com/python/pythondotorg/blob/main/apps/agreements/orders/kinds.py"
click node_agreement_registry "https://github.com/python/pythondotorg/blob/main/apps/agreements/registry.py"
click node_agreement_docs "https://github.com/python/pythondotorg/blob/main/apps/agreements/documents.py"
click node_order_docs "https://github.com/python/pythondotorg/blob/main/apps/agreements/orders/documents.py"
click node_sponsor_views "https://github.com/python/pythondotorg/blob/main/apps/sponsors/views.py"
click node_sponsor_models "https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/sponsors.py"
click node_sponsorship_models "https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/sponsorship.py"
click node_benefit_features "https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/benefits.py"
click node_sponsor_assets "https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/assets.py"
click node_benefit_queries "https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/managers.py"
click node_job_notifications "https://github.com/python/pythondotorg/blob/main/apps/jobs/listeners.py"
click node_job_signals "https://github.com/python/pythondotorg/blob/main/apps/jobs/signals.py"
click node_user_listeners "https://github.com/python/pythondotorg/blob/main/apps/users/listeners.py"
click node_core_signals "https://github.com/python/pythondotorg/blob/main/pydotorg/signals.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_site,node_pages,node_blogs,node_cms,node_banners,node_staff toneBlue
class node_downloads,node_events,node_jobs,node_community,node_job_notifications,node_job_signals,node_postgres toneAmber
class node_agreements_workflow,node_agreement_kinds,node_order_kinds,node_agreement_registry,node_agreement_docs,node_order_docs toneMint
class node_sponsor_views,node_sponsor_models,node_sponsorship_models,node_benefit_features,node_sponsor_assets,node_benefit_queries toneRose
class node_accounts,node_user_listeners,node_core_signals,node_visitor,node_sponsor,node_email toneIndigo
```

## Components

### Site and content

- [Python.org site](https://github.com/python/pythondotorg/blob/main/pydotorg/urls.py): `pydotorg/urls.py`
- [Pages](https://github.com/python/pythondotorg/blob/main/apps/pages/views.py): `apps/pages/views.py`
- [Blogs](https://github.com/python/pythondotorg/blob/main/apps/blogs/views.py): `apps/blogs/views.py`
- [CMS](https://github.com/python/pythondotorg/blob/main/apps/cms/views.py): `apps/cms/views.py`
- [Banners](https://github.com/python/pythondotorg/blob/main/apps/banners/models.py): `apps/banners/models.py`

### Community services

- [Downloads](https://github.com/python/pythondotorg/blob/main/apps/downloads/views.py): `apps/downloads/views.py`
- [Events](https://github.com/python/pythondotorg/blob/main/apps/events/views.py): `apps/events/views.py`
- [Job board](https://github.com/python/pythondotorg/blob/main/apps/jobs/views.py): `apps/jobs/views.py`
- [Community](https://github.com/python/pythondotorg/blob/main/apps/community/views.py): `apps/community/views.py`
- [Job notifications](https://github.com/python/pythondotorg/blob/main/apps/jobs/listeners.py): `apps/jobs/listeners.py`
- [Job signals](https://github.com/python/pythondotorg/blob/main/apps/jobs/signals.py): `apps/jobs/signals.py`

### Agreements

- [Agreement workflow](https://github.com/python/pythondotorg/blob/main/apps/agreements/workflow.py): `apps/agreements/workflow.py`
- [Agreement kinds](https://github.com/python/pythondotorg/blob/main/apps/agreements/kinds.py): `apps/agreements/kinds.py`
- [Order kinds](https://github.com/python/pythondotorg/blob/main/apps/agreements/orders/kinds.py): `apps/agreements/orders/kinds.py`
- [Kind registry](https://github.com/python/pythondotorg/blob/main/apps/agreements/registry.py): `apps/agreements/registry.py`
- [Document composition](https://github.com/python/pythondotorg/blob/main/apps/agreements/documents.py): `apps/agreements/documents.py`
- [Order documents](https://github.com/python/pythondotorg/blob/main/apps/agreements/orders/documents.py): `apps/agreements/orders/documents.py`

### Sponsorship

- [Sponsor management](https://github.com/python/pythondotorg/blob/main/apps/sponsors/views.py): `apps/sponsors/views.py`
- [Sponsor records](https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/sponsors.py): `apps/sponsors/models/sponsors.py`
- [Programs and benefits](https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/sponsorship.py): `apps/sponsors/models/sponsorship.py`
- [Benefit features](https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/benefits.py): `apps/sponsors/models/benefits.py`
- [Sponsor assets](https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/assets.py): `apps/sponsors/models/assets.py`
- [Benefit queries](https://github.com/python/pythondotorg/blob/main/apps/sponsors/models/managers.py): `apps/sponsors/models/managers.py`

### Application core

- [User accounts](https://github.com/python/pythondotorg/blob/main/apps/users/models.py): `apps/users/models.py`
- [Account listeners](https://github.com/python/pythondotorg/blob/main/apps/users/listeners.py): `apps/users/listeners.py`
- [Core signals](https://github.com/python/pythondotorg/blob/main/pydotorg/signals.py): `pydotorg/signals.py`

### Other components

- **Site visitor**
- **Staff user**
- **Sponsor**
- **PostgreSQL**
- **Email service**

## Connections

- Site visitor → Python.org site: browses
- Staff user → Python.org site: manages
- Sponsor → Sponsor management: manages benefits
- Python.org site → Pages: routes to
- Python.org site → Blogs: routes to
- Python.org site → CMS: routes to
- Python.org site → Banners: renders
- Python.org site → Downloads: routes to
- Python.org site → Events: routes to
- Python.org site → Job board: routes to
- Python.org site → Community: routes to
- Python.org site → Agreement workflow: routes to
- Python.org site → Sponsor management: routes to
- User accounts → PostgreSQL: persists in
- Agreement workflow → Agreement kinds: uses
- Agreement kinds → Kind registry: registers with (evidence: `apps/agreements/kinds.py`)
- Agreement kinds → Document composition: composes with (evidence: `apps/agreements/kinds.py`)
- Order kinds → Kind registry: registers with (evidence: `apps/agreements/orders/kinds.py`)
- Order kinds → Order documents: composes with (evidence: `apps/agreements/orders/kinds.py`)
- Sponsor management → Sponsor records: manages
- Sponsor records → Programs and benefits: relates to
- Programs and benefits → Benefit features: configures
- Benefit features → Sponsor assets: uses (evidence: `apps/sponsors/models/benefits.py`)
- Benefit queries → Benefit features: queries (evidence: `apps/sponsors/models/managers.py`)
- Job board → Job signals: emits events
- Job signals → Job notifications: dispatches (evidence: `apps/jobs/listeners.py`)
- Job notifications → Email service: sends mail (evidence: `apps/jobs/listeners.py`)
- User accounts → Account listeners: triggers save (evidence: `apps/users/listeners.py`)
- Account listeners → User accounts: creates token (evidence: `apps/users/listeners.py`)
- Core signals → Python.org site: supports application
