{"id":31772039,"url":"https://github.com/aboutcode-org/django-altcha","last_synced_at":"2026-03-05T08:11:50.320Z","repository":{"id":284764157,"uuid":"955813646","full_name":"aboutcode-org/django-altcha","owner":"aboutcode-org","description":"Django field and widget for Altcha CAPTCHA.","archived":false,"fork":false,"pushed_at":"2025-07-25T07:25:37.000Z","size":74,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-09-27T17:02:27.375Z","etag":null,"topics":["altcha","captcha","django","open-source"],"latest_commit_sha":null,"homepage":"https://django-altcha.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aboutcode-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.rst","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"aboutcode-org"}},"created_at":"2025-03-27T08:37:40.000Z","updated_at":"2025-09-07T01:52:13.000Z","dependencies_parsed_at":"2025-03-27T15:34:14.264Z","dependency_job_id":"2af78c7d-a2cd-452f-be65-4ac33f4ab842","html_url":"https://github.com/aboutcode-org/django-altcha","commit_stats":null,"previous_names":["aboutcode-org/django-altcha"],"tags_count":6,"template":false,"template_full_name":"aboutcode-org/skeleton","purl":"pkg:github/aboutcode-org/django-altcha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutcode-org%2Fdjango-altcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutcode-org%2Fdjango-altcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutcode-org%2Fdjango-altcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutcode-org%2Fdjango-altcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aboutcode-org","download_url":"https://codeload.github.com/aboutcode-org/django-altcha/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutcode-org%2Fdjango-altcha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002601,"owners_count":26083426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["altcha","captcha","django","open-source"],"created_at":"2025-10-10T03:55:11.186Z","updated_at":"2025-10-10T03:55:17.359Z","avatar_url":"https://github.com/aboutcode-org.png","language":"Python","readme":"# Django Altcha\n\n**Django Altcha** is a Django library that provides easy integration of Altcha CAPTCHA\ninto your Django forms, enhancing user verification with configurable options.\n\nBy default, CAPTCHA validation operates in a **fully self-hosted mode**, \n**eliminating the need for external services** while ensuring privacy and control over\nthe verification process.\n\n**Django Altcha** is **secure by default**, featuring built-in \n**protection against replay attacks** to ensure each challenge is validated only once. \nThis helps safeguard your forms from repeated or spoofed submissions without \nrequiring additional configuration.\n\n## Installation\n\n1. **Install the package:**\n\n   ```bash\n   pip install django-altcha\n   ```\n\n2. **Add to `INSTALLED_APPS`:**\n\n   Update your Django project's `settings.py`:\n\n   ```python\n   INSTALLED_APPS = [\n       # Other installed apps\n       \"django_altcha\",\n   ]\n   ```\n\n3. **Set your secret HMAC key:**\n   \n   This key is used to HMAC-sign ALTCHA challenges and **must be kept secret**.\n   Treat it like a password: use a secure, 64-character hex string.\n\n   Update your Django project's `settings.py`:\n\n   ```python\n   ALTCHA_HMAC_KEY=\"your_secret_hmac_key\"\n   ```\n\n\u003e [!NOTE]\n\u003e You can generate a new secured HMAC key using:\n\u003e ``python -c \"import secrets; print(secrets.token_hex(64))\"``\n\n\n## Usage\n\n### Adding the CAPTCHA Field to Your Form\n\nTo add the Altcha CAPTCHA field to a Django form, import `AltchaField` and add it to\nyour form definition:\n\n```python\nfrom django import forms\nfrom django_altcha import AltchaField\n\nclass MyForm(forms.Form):\n    captcha = AltchaField()\n```\n\n## Configuration Options\n\nYou can pass configuration options to `AltchaField` that are supported by Altcha.\nThese options are documented at\n[Altcha's website integration guide](https://altcha.org/docs/website-integration/).\n\n### Example with additional options:\n\n```python\nfrom django import forms\nfrom django_altcha import AltchaField\n\nclass MyForm(forms.Form):\n    captcha = AltchaField(\n        floating=True,   # Enables floating behavior\n        debug=True,      # Enables debug mode (for development)\n        # Additional options supported by Altcha\n    )\n```\n\n### Register a URL to Provide the Challenge\n\nBy default, challenge data is generated by the `AltchaField` and embedded directly \ninto the rendered HTML using the `challengejson` option.\n\nAlternatively, you can provide a URL that the Altcha widget’s JavaScript will fetch to \nretrieve the challenge, using the `challengeurl` option.\n\nThis approach is especially useful for enabling features like `refetchonexpire`, \nwhich **only work** when using a `challengeurl` (not `challengejson`).\n\nA ready-to-use `AltchaChallengeView` is available in `django_altcha`. \nTo enable it, register the view in your `urlpatterns`, for example:\n\n```python\nfrom django.urls import path\nfrom django_altcha import AltchaChallengeView\n\nurlpatterns += [\n    path(\"altcha/challenge/\", AltchaChallengeView.as_view(), name=\"altcha_challenge\"),\n]\n```\n\nOnce the URL is registered, you can configure your `AltchaField` to use it via the \n`challengeurl` option:\n\n```python\nfrom django.urls import reverse_lazy\nfrom django import forms\nfrom django_altcha import AltchaField\n\nclass MyForm(forms.Form):\n    captcha = AltchaField(\n        challengeurl=reverse_lazy(\"altcha_challenge\"),\n    )\n```\n\n\u003e [!NOTE]\n\u003e You can customize the challenge generation by passing options directly when \n\u003e registering the view.\n\u003e For example: ``AltchaChallengeView.as_view(max_number=2000000)``\n\n## Settings\n\n### ALTCHA_HMAC_KEY\n\n**Required.** This key is used to HMAC-sign ALTCHA challenges and **must be kept secret**.\n\n### ALTCHA_JS_URL\n\nURL location of the Altcha JavaScript file.\nDefault to the django-altcha embedded file.\n\n### ALTCHA_VERIFICATION_ENABLED\n\nSet to `False` to skip Altcha validation altogether.\n\n### ALTCHA_CHALLENGE_EXPIRE\n\nChallenge expiration duration in milliseconds.\nDefault to 20 minutes as per Altcha security recommendations.\nSee https://altcha.org/docs/v2/security-recommendations/\n\n## Contributing\n\nWe welcome contributions to improve this library.\nFeel free to submit issues or pull requests!\n\n## License\n\nThis project is licensed under the **MIT License**.\nSee the [LICENSE](./LICENSE) file for details.\n","funding_links":["https://github.com/sponsors/aboutcode-org"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboutcode-org%2Fdjango-altcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faboutcode-org%2Fdjango-altcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboutcode-org%2Fdjango-altcha/lists"}