Production-oriented Django integration for the Click.uz payment gateway
Project description
django-click-uz
Production-oriented Django 5+ integration for the Click.uz Shop API: payment URLs, prepare/complete webhooks, MD5 signatures, optional audit log, replay protection, HTTPS / IP checks for callbacks.
| Uzbek (full tutorial) | README_UZ.md |
| Changelog | CHANGELOG.md |
| Repository | github.com/Matnazar-Matnazarov/django-click-uz |
| Extra Markdown docs | docs/ (MkDocs sources) |
What’s in the package
| Part | Role |
|---|---|
click_uz |
Django app: INSTALLED_APPS, migrations, urls, views (prepare / complete / callback / webhook), webhook_guard, ModelOrderHandler, signals, Uzbek locale/uz. |
click_up |
Same codebase, import-only compatibility (ClickUp, ClickWebhook, generate_pay_link style). Not an INSTALLED_APPS entry. |
| Config | CLICK dict or flat CLICK_* settings; optional WEBHOOK_ALLOWED_CIDRS, WEBHOOK_REQUIRE_HTTPS, etc. |
| Tests / dev | pytest, ruff, mkdocs (optional local doc site). |
Requirements
- Python 3.12+
- Django 5.0+
Install
pip install django-click-uz
INSTALLED_APPS = [
# ...
"click_uz",
]
Configuration (summary)
Option A — CLICK dict (recommended):
CLICK = {
"SERVICE_ID": os.getenv("CLICK_SERVICE_ID"),
"MERCHANT_ID": os.getenv("CLICK_MERCHANT_ID"),
"SECRET_KEY": os.getenv("CLICK_SECRET_KEY"),
"ACCOUNT_MODEL": "order.Order",
"AMOUNT_FIELD": "amount",
"STATUS_FIELD": "status",
"STATUS_WAITING": "waiting_payment",
"MERCHANT_TRANS_FIELD": "transaction_param",
"COMMISSION_PERCENT": 0,
"DISABLE_ADMIN": False,
}
Option B — flat CLICK_* (legacy click-pkg style): see Configuration in docs/.
Webhooks need HANDLER_CLASS or ACCOUNT_MODEL + AMOUNT_FIELD + STATUS_FIELD. If both dict and flat keys exist, CLICK wins.
Integration checklist
settings.py—click_uzinINSTALLED_APPS; setCLICKorCLICK_*.models.py— order model withamount,status, optionaltransaction_param.urls.py— e.g.path("payment/click/", include("click_uz.urls"))→ webhook at…/payment/click/webhook/, or mount your ownClickWebhooksubclass.views.py— overridesuccessfully_payment,cancelled_payment, optionalprepare_accepted.- Pay link —
ClickUp().initializer.generate_pay_link(...); see README_UZ.md for stable vs uniquetransaction_param. - Migrate —
python manage.py migrate.
Compared to older click-pkg tutorials: PyPI name is django-click-uz; only click_uz goes in INSTALLED_APPS.
Documentation (local)
There is no hosted ReadTheDocs site for this repo. To browse the MkDocs site locally:
uv sync --all-extras # or: pip install -e ".[dev]"
mkdocs serve
Then open the URL shown in the terminal (usually http://127.0.0.1:8000). Sources live under docs/.
Security & operations
- Click JSON responses use English; admin/config strings can use
click_uztranslations (locale/uz/). - Signature checks on webhook payloads are the main authenticity control.
- HTTPS + optional IP allowlist:
click_uz.webhook_guardandCLICK["WEBHOOK_*"]; behind TLS termination setSECURE_PROXY_SSL_HEADER.
Development
pip install -e ".[dev]"
pytest
Release workflow: bump version in pyproject.toml, update CHANGELOG.md, commit, then tag vX.Y.Z (e.g. v0.1.1) and git push origin vX.Y.Z — see .github/workflows/publish.yml. If a tag already exists, use the next version number.
License
MIT — see LICENSE.
Official Click API reference: docs.click.uz.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_click_uz-0.1.1.tar.gz.
File metadata
- Download URL: django_click_uz-0.1.1.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c347f5b9847198819941b6c2f8ab785b6709bf6d220653413945ee2f02b5e07
|
|
| MD5 |
8e1e80fe9d014863310fb41c6302b0c0
|
|
| BLAKE2b-256 |
e5f38f14784811af126dc5cd646b3aa1ff903f8b9d92fba4a9293c9d404698ba
|
Provenance
The following attestation bundles were made for django_click_uz-0.1.1.tar.gz:
Publisher:
publish.yml on Matnazar-Matnazarov/django-click-uz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_click_uz-0.1.1.tar.gz -
Subject digest:
9c347f5b9847198819941b6c2f8ab785b6709bf6d220653413945ee2f02b5e07 - Sigstore transparency entry: 1239424493
- Sigstore integration time:
-
Permalink:
Matnazar-Matnazarov/django-click-uz@53f156a68ea6f384f9329403ec876ad5d258459f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Matnazar-Matnazarov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@53f156a68ea6f384f9329403ec876ad5d258459f -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_click_uz-0.1.1-py3-none-any.whl.
File metadata
- Download URL: django_click_uz-0.1.1-py3-none-any.whl
- Upload date:
- Size: 27.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c6220a951118d00be8b5a8bdded99f015d0b28be28efbcf2cf777101d7a3ae2
|
|
| MD5 |
853858da2d3c165615cdec866d2ba804
|
|
| BLAKE2b-256 |
0f9b7b071aef42c4034754f47233f09e4bf3ea4695b06874455bf432c6f89b82
|
Provenance
The following attestation bundles were made for django_click_uz-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Matnazar-Matnazarov/django-click-uz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_click_uz-0.1.1-py3-none-any.whl -
Subject digest:
2c6220a951118d00be8b5a8bdded99f015d0b28be28efbcf2cf777101d7a3ae2 - Sigstore transparency entry: 1239424494
- Sigstore integration time:
-
Permalink:
Matnazar-Matnazarov/django-click-uz@53f156a68ea6f384f9329403ec876ad5d258459f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Matnazar-Matnazarov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@53f156a68ea6f384f9329403ec876ad5d258459f -
Trigger Event:
push
-
Statement type: