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 600 (10 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 inserts a new <version> (<YYYY-MM-DD>) section directly below the top changelog section, preserving the unreleased heading.

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.1.tar.gz (23.3 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.1-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: djangocms_gh_stats-2026.6.28.1.tar.gz
  • Upload date:
  • Size: 23.3 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.1.tar.gz
Algorithm Hash digest
SHA256 797a6da3fa846bd311a3b7d96abeb8207c23040fecaa45d4bd9961bcbb92855b
MD5 e08b6d4bb597a196305c45a7a5febd2d
BLAKE2b-256 545bd641bf0577cd49fc79b16e5ccbccdfb41f72b18ff234a4abf0cc5af15bf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for djangocms_gh_stats-2026.6.28.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_gh_stats-2026.6.28.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f843227cbff0d1ca31ba6952d106f0d4d4d13ff9b66f462f5c89e73f26b2ff5
MD5 b1cd3a150890e7261fc6986ed58aac83
BLAKE2b-256 6a2d16aaa9a63f37a48d622eda66d2ea58bf26d41f495f94d7f0672e41e63c8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for djangocms_gh_stats-2026.6.28.1-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