百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

django-coupons

> 编程语言
开源

一个可重复使用的 Django 应用,用于生成和处理优惠券。

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个可重复使用的 Django 应用,用于生成和处理优惠券。

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

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