{ "info": { "author": "Jack Novotny", "author_email": "jacknovotny8@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# Djaptcha\n\nDjaptcha is a Django plugin that implements the `captcha` python package by `lepture`. It is designed to store user sessions in the database and generate random captcha images based on these sessions.\n\n## Installation\n\nIf you haven't already, `pip install captcha` and then use the following to install `djaptcha`:\n\n```bash\n$ pip install djaptcha\n```\n\nNow add `djaptcha` to the list of installed plugins in your Django app.\n\n```python\nINSTALLED_APPS = [\n ...\n 'djaptcha',\n ...\n]\n```\n\n*__Note__: You must have sessions enabled and configured in your django app to use this plugin. You also must have configured a database. End users must have cookies enabled in their browser to be able to generate captcha images.*\n\nFinally, run `python manage.py make_migrations` and `python manage.py migrate` to create the djaptcha database models.\n\n## Settings\n\nIt's recommended that you change the following settings to suit your specific project needs:\n```python\n# These are the default values\nDJAPTCHA_MAX_TRIES = 10 # Maximum amount of tries before user can't generate new captchas\nDJAPTCHA_LENGTH = 6 # Length of the captcha (example: 'F7W8MG' has a length of 6)\nDJAPTCHA_CHARACTERS = 'ABCEFGHJKLMNPRSTUVWXYZ' # Characters allowed in the captcha\nDJAPTCHA_URL = STATIC_URL + 'captcha/' # The URL that end users can access captcha images at\nDJAPTCHA_DIR = 'static/captcha/' # The local directory your captcha images should be stored in\nDJAPTCHA_EXPIRY = 5 # Length in minutes before the captcha and image are deleted\nDJAPTCHA_COOKIES_TEMPLATE = 'djaptcha/cookies.html' # The template that tells users to enable cookies\n```\n\n## Usage\n\nTo add a captcha field to your form you need to follow these steps:\n\n1. Add the `CaptchaMixin` to your View class. *`CaptchaMixin` should be on the far left to ensure it's methods have priority*\n```python\nfrom djaptcha.views import CaptchaMixin\n\nclass MyView(CaptchaMixin, FormView):\n form_class = MyForm\n # View logic here\n```\n\n2. Add the `CaptchaForm` to your Form class. *`CaptchaForm` should be on the far left to ensure the captcha is validated before any other data.*\n```python\nfrom djaptcha.forms import CaptchaForm\n\nclass MyForm(CaptchaForm, Form)\n # Form fields and logic here.\n pass\n```\n\n3. Djaptcha also provides some context variables to use in your views. You can use them like so in your form templates:\n```html\n\n
\n {% csrf_token %}\n {{ form.as_p }}\n

Refresh

\n

{{ captcha_retries }} retries left.

\n \n
\n```\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jackno/djaptcha", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "djaptcha", "package_url": "https://pypi.org/project/djaptcha/", "platform": "", "project_url": "https://pypi.org/project/djaptcha/", "project_urls": { "Homepage": "https://github.com/jackno/djaptcha" }, "release_url": "https://pypi.org/project/djaptcha/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Djaptcha is a Django plugin that implements the captcha python package by lepture.", "version": "0.0.1" }, "last_serial": 4856971, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "027452adc10fca6f93a7e313d96d9fab", "sha256": "2115ae39b13d5c77a2eb4d5b249fb91d1c4385e77f460f6898e3b1962d14e238" }, "downloads": -1, "filename": "djaptcha-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "027452adc10fca6f93a7e313d96d9fab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8563, "upload_time": "2019-02-23T02:24:42", "url": "https://files.pythonhosted.org/packages/4b/ce/9c07de258715b4d2b64ff37b552e07f1371c6e584ed61a733b2a006249bb/djaptcha-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "40f86ca581f652eea5a310798f7d619f", "sha256": "a155a5760cce3541afe08237893b1e7886fdd12d89c77312fcbee164ba4098e2" }, "downloads": -1, "filename": "djaptcha-0.0.1.tar.gz", "has_sig": false, "md5_digest": "40f86ca581f652eea5a310798f7d619f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6374, "upload_time": "2019-02-23T02:24:44", "url": "https://files.pythonhosted.org/packages/4a/20/f2d22b9e212da2076c3effc4168ca89d1035128e39d52666f0c5bcd7699e/djaptcha-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "027452adc10fca6f93a7e313d96d9fab", "sha256": "2115ae39b13d5c77a2eb4d5b249fb91d1c4385e77f460f6898e3b1962d14e238" }, "downloads": -1, "filename": "djaptcha-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "027452adc10fca6f93a7e313d96d9fab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8563, "upload_time": "2019-02-23T02:24:42", "url": "https://files.pythonhosted.org/packages/4b/ce/9c07de258715b4d2b64ff37b552e07f1371c6e584ed61a733b2a006249bb/djaptcha-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "40f86ca581f652eea5a310798f7d619f", "sha256": "a155a5760cce3541afe08237893b1e7886fdd12d89c77312fcbee164ba4098e2" }, "downloads": -1, "filename": "djaptcha-0.0.1.tar.gz", "has_sig": false, "md5_digest": "40f86ca581f652eea5a310798f7d619f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6374, "upload_time": "2019-02-23T02:24:44", "url": "https://files.pythonhosted.org/packages/4a/20/f2d22b9e212da2076c3effc4168ca89d1035128e39d52666f0c5bcd7699e/djaptcha-0.0.1.tar.gz" } ] }