Skip to main content

A django CMS plugin to display GitHub statistics for organisations and repositories.

Project description

https://img.shields.io/pypi/v/djangocms-gh-stats.svg https://github.com/marksweb/djangocms_gh_stats/actions/workflows/ci.yml/badge.svg

A django CMS plugin package that fetches statistics from the GitHub REST API and displays them on your CMS-powered website.

Features

The package ships the following CMS plugins, all configurable to target either a GitHub organisation or a specific repository:

  • GitHub Stars — display the star count of a repository.

  • GitHub Forks — display the fork count of a repository.

  • GitHub Open Issues — display the open issue count of a repository.

  • GitHub Contributors — display an avatar grid of top contributors.

Installation

Install using uv (recommended):

uv add djangocms-gh-stats

Or using pip:

pip install djangocms-gh-stats

Configuration

Add the application to INSTALLED_APPS in your Django settings:

INSTALLED_APPS = [
    ...
    "djangocms_gh_stats",
    ...
]

Run the database migrations:

python manage.py migrate djangocms_gh_stats

Optional settings

DJANGOCMS_GH_STATS_TOKEN

A GitHub Personal Access Token (PAT) for authenticated API requests. Unauthenticated requests are subject to GitHub’s lower rate limit of 60 requests per hour per IP address. Providing a token raises this limit to 5,000 requests per hour:

DJANGOCMS_GH_STATS_TOKEN = "github_pat_..."
DJANGOCMS_GH_STATS_CACHE_TIMEOUT

How long (in seconds) to cache API responses. Defaults to 300 (5 minutes). Set to 0 to disable caching:

DJANGOCMS_GH_STATS_CACHE_TIMEOUT = 600

Usage

After installation, the following plugins are available in the django CMS plugin picker under the GitHub Stats module:

  • GitHub Stars

  • GitHub Forks

  • GitHub Open Issues

  • GitHub Contributors

Each plugin has the following configuration fields:

  • Scope — choose between Organisation or Repository.

  • Organisation — the GitHub organisation or user name (e.g. django-cms).

  • Repository — the repository name (required when scope is Repository).

Development

This project is managed with uv.

Clone the repository and install dependencies:

git clone https://github.com/marksweb/djangocms_gh_stats.git
cd djangocms_gh_stats
uv sync

Run the tests:

uv run pytest

Run the linter:

uv run ruff check djangocms_gh_stats/ tests/

Releasing

Releases are created with the Release and Publish GitHub Actions workflow.

The workflow uses CalVer tags in YYYY.M.D format and can append .N for multiple releases on the same day.

To create a release:

  1. Run the workflow from the Actions tab.

  2. Optionally provide a CalVer version (for example 2026.6.28).

  3. The workflow creates the Git tag, creates a GitHub release, builds with uv, and publishes to PyPI via trusted publishing.

  4. The workflow updates djangocms_gh_stats/__init__.py and promotes the changelog (unreleased) section to <version> (<YYYY-MM-DD>).

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the BSD 3-Clause License — see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangocms_gh_stats-2026.6.28.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djangocms_gh_stats-2026.6.28-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file djangocms_gh_stats-2026.6.28.tar.gz.

File metadata

  • Download URL: djangocms_gh_stats-2026.6.28.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for djangocms_gh_stats-2026.6.28.tar.gz
Algorithm Hash digest
SHA256 e2b3eca2b0ae3a144410fdd8eac1f6b1591ec75768c4cbd1ff5ceabb882a5a08
MD5 3f60ed1b78fc77e5d9420c65ed79e4c4
BLAKE2b-256 55cecbfdef17c793cc3ab02a2ebdf89f680c1de55a2958292d3269c7092f5305

See more details on using hashes here.

Provenance

The following attestation bundles were made for djangocms_gh_stats-2026.6.28.tar.gz:

Publisher: release.yml on marksweb/djangocms_gh_stats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djangocms_gh_stats-2026.6.28-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_gh_stats-2026.6.28-py3-none-any.whl
Algorithm Hash digest
SHA256 1f8366d024566074c23ef2897e8678d081d86a58cd23d255e01a5a75e851504e
MD5 042e69ffa26302bb63f44e5f6c0198f5
BLAKE2b-256 5f5eddb911ce83cec2cf2fd51a9d2b5393a3107b7eab8537d8acd867b4217960

See more details on using hashes here.

Provenance

The following attestation bundles were made for djangocms_gh_stats-2026.6.28-py3-none-any.whl:

Publisher: release.yml on marksweb/djangocms_gh_stats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page