A reuseable Django application for coupon gereration and handling.
A reuseable Django application for coupon gereration and handling.
A reusable Django application for coupon generation and redemption.
python -m pip install django-couponsAdd "coupons" to INSTALLED_APPS, then apply its migrations:
python manage.py migrateCoupons can be configured for these redemption patterns:
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.
Install uv, then create the locked development environment and run all local checks:
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 buildCI additionally tests Django 5.2, 6.0, and 6.1 across Python 3.12–3.14.
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.
No open issues yet, or sync has not completed.