Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

django-coupons

> 编程语言
Open source

A reuseable Django application for coupon gereration and handling.

100 stars0 likes0 views
WebsiteGitHub

About

A reuseable Django application for coupon gereration and handling.

django-coupons

A reusable Django application for coupon generation and redemption.

Requirements

  • Python 3.12+
  • Django 5.2 through 6.1

Installation

bash
python -m pip install django-coupons

Add "coupons" to INSTALLED_APPS, then apply its migrations:

bash
python manage.py migrate

Coupon use cases

Coupons can be configured for these redemption patterns:

  1. Single-use: one redemption without requiring a user.
  2. User-limited: one redemption by a specific user.
  3. Limited-use: a fixed number of redemptions, once per user.
  4. User list: one redemption by each specified user.
  5. Unlimited: unlimited redemptions overall, but only once per user.

Coupon types default to monetary, percentage, and virtual currency. Override COUPONS_COUPON_TYPES to provide application-specific choices. Code length, characters, segmentation, and separators can also be configured with the COUPONS_* settings in coupons/settings.py.

Development

Install uv, then create the locked development environment and run all local checks:

bash
uv sync --locked
uv run ruff check .
uv run ruff format --check .
uv run coverage run -m django test --settings=coupons.tests.settings
uv run coverage report
uv run django-admin check --settings=coupons.tests.settings
uv run django-admin makemigrations --check --dry-run --settings=coupons.tests.settings
uv build

CI additionally tests Django 5.2, 6.0, and 6.1 across Python 3.12–3.14.

Releasing

Releases use PyPI Trusted Publishing; no API token is stored in GitHub. The PyPI publisher must be configured with repository owner byteweaver, repository django-coupons, workflow publish.yml, and environment pypi.

To publish, update the project version and changelog, commit those changes, and create a GitHub release whose tag exactly matches the version with a v prefix (for example, v2.0.0rc1). Publishing the GitHub release builds the distributions and uploads them to PyPI with uv publish.

Issues· 4 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言