{ "info": { "author": "Ricardo S. A. Silva", "author_email": "ricardo@salamandra.cc", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "# Introduction #\n\n\nA Django app to validate cell phone numbers through SMS messages.\n\n It uses Django Rest to implement a couple of endpoints to confirm the number and django-sendsms to send messages.\n\n\n## Installation ##\n\n\n1. Install package:\n\n pip install django_phone_confirmation\n\n2. Add phone_confirmation app to INSTALLED_APPS in your django settings.py:\n\n INSTALLED_APPS = (\n ...,\n 'rest_framework',\n 'phone_confirmation',\n )\n\n3. Add in urls.py:\n\n urlpatterns = patterns('',\n url(r'^phone-confirmation/', include('phone_confirmation.urls', namespace='phone_confirmation')),\n )\n\n\n## A basic flow ##\n\n1. User inputs cell phone number.\n1. The app/page make a POST request to the **phone-confirmation/confirmation/** endpoint with the phone number entered by the user.\n1. An SMS message is sent to the phone number with a 4 number code.\n1. The user enter the code on the App/Page\n1. The app/page make a POST request to the **phone-confirmation/activation-key/** endpoint with the code entered by the user.\n The response is a signed activation key if the code is correct, or a 400 status response otherwise.\n1. Then the app/page can use the phone number or save the activation key to use it later.\n\n\n## Endpoints ##\n\n### phone-confirmation/confirmation/ ###\n\nRequest example:\n\n curl -X POST \\\n http://localhost:8000/phone-confirmation/confirmation/ \\\n -H 'cache-control: no-cache' \\\n -H 'content-type: application/json' \\\n -d '{\n \t\"phone_number\": \"+1-202-555-1234\"\n }'\n\nResponse example:\n\n {\"phone_number\": \"+12025551234\"}\n\nAnd the code 6108 (just a example, the code is picked randomly) is sent by SMS to the phone.\n\n\n### phone-confirmation/activation-key/ ###\n\n\nRequest example:\n\n curl -X POST \\\n http://localhost:8000/phone-confirmation/activation-key/ \\\n -H 'cache-control: no-cache' \\\n -H 'content-type: application/json' \\\n -d '{\n \t\"phone_number\": \"+1-202-555-1234\",\n \t\"code\": \"6108\"\n }'\n\nSuccessful response example:\n\n {\"activation_key\":\"eyJwaG9uZV9udW1iZXIiOiIrMTIwMjU1NTEyMzQifQ:1dHsio:RvZd7XLwZPvWrN0OI4jA2R5PT8Q\"}\n\nFail response example:\n\n {\"error\": \"Invalid activation key\"}\n\n\n### phone-confirmation/activation-key/{activation key}/ ###\n\nRequest example:\n\n\n curl -X GET \\\n http://localhost:8000/phone-confirmation/activation-key/eyJwaG9uZV9udW1iZXIiOiIrMTIwMjU1NTEyMzQifQ:1dHsio:RvZd7XLwZPvWrN0OI4jA2R5PT8Q/ \\\n -H 'cache-control: no-cache' \\\n -H 'content-type: application/json'\n\n\nResponse example:\n\n {\"phone_number\": \"+12025551234\"}\n\n\n\n## Settings ##\n\n These are the default settings:\n\n PHONE_CONFIRMATION = {\n \"SALT\": \"phonenumber\",\n \"ACTIVATION_TIMEOUT\": 15,\n \"SMS_MESSAGE\": \"Your confirmation code is %(code)s\",\n \"FROM_NUMBER\": \"\",\n \"MAX_CONFIRMATIONS\": 10\n }\n\n\n**SALT**\n\n Used as salt when creating activation keys.\n\n**ACTIVATION_TIMEOUT**\n\n How many seconds the user have to confirm the number after the initial requesting\n\n**SMS_MESSAGE**\n The SMS message that will be send to users. The default message is \"Your confirmation code is %(code)s\".\n Use %{code}s variable to indicate where the confirmation code should be placed.\n\n**FROM_NUMBER**\n\n The number to use as sender of the SMS messages. You should use the number provided by your SMS gateway. This is the only required setting.\n\n**MAX_CONFIRMATIONS**\n\n The maximum number of confirmations to keep in database for each phone number. When this amount is reached, the oldest confirmation is removed.\n\n\n **NOTE:** As we use the django-sendsms package you need to configure it with your SMS Gateway in order to delivery SMS messages.\n\n**SILENT_CONFIRMATIONS_FILTER**\n\n A callable with a single argument to ignore fake tests numbers. If it returns True the SMS won't be send.\n\n Example:\n SILENT_CONFIRMATIONS_FILTER = lambda to: to[:8] == '+1212555' # Ignore numbers starting with +1212555.\n\n\n## Throttle Scope ##\n\n - phone-number-confirmation: Endpoint to request a phone number confirmation (Wiil sent SMS)\n - phone-confirmation-activation-key: Endpoints to validate codes and activation keys.\n\n\n## Changelog ##\n\n0.3.3 - Changed settings ACTIVATION_MINUTES to ACTIVATION_TIMEOUT and the period time to seconds. Changed settingg SMS_TEMPLATE to SMS_MESSAGE.\n0.3.4 - Add activation_key_created signal.\n0.3.5 - Add user to activation_key_created signal.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ricardosasilva/django_phone_confirmation", "keywords": "django cell phone confirmation", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django_phone_confirmation", "package_url": "https://pypi.org/project/django_phone_confirmation/", "platform": "", "project_url": "https://pypi.org/project/django_phone_confirmation/", "project_urls": { "Homepage": "https://github.com/ricardosasilva/django_phone_confirmation" }, "release_url": "https://pypi.org/project/django_phone_confirmation/0.3.7/", "requires_dist": null, "requires_python": "", "summary": "A Django app to validate cell phone numbers through SMS messages and REST.", "version": "0.3.7" }, "last_serial": 4161027, "releases": { "0.2.4": [ { "comment_text": "", "digests": { "md5": "a9ef064d0f7d8a3adadd428aedfaf2c1", "sha256": "2a481ca4f727ae9b45534ca394be4ce26e1bd63d5a9a87baec643e99cc661be6" }, "downloads": -1, "filename": "django_phone_confirmation-0.2.4.tar.gz", "has_sig": false, "md5_digest": "a9ef064d0f7d8a3adadd428aedfaf2c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5940, "upload_time": "2017-06-12T20:08:45", "url": "https://files.pythonhosted.org/packages/94/55/218131a7fbca8e8c13b5e7aa1d600fceb582bec62192836ff9d913851ca1/django_phone_confirmation-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "1c430e616c16fffcb25962a5a514d09e", "sha256": "4b2746e9696220464a6584c1f0c0d59601da4969bc22d6c90219b880faa4e222" }, "downloads": -1, "filename": "django_phone_confirmation-0.2.5.tar.gz", "has_sig": false, "md5_digest": "1c430e616c16fffcb25962a5a514d09e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6264, "upload_time": "2017-06-14T03:21:40", "url": "https://files.pythonhosted.org/packages/17/eb/46f2036240ce4efb40eb81d0a044bf48cf9799d342b23c58d443bc344368/django_phone_confirmation-0.2.5.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e9c9b149b8e0a73e307b76f9119b18be", "sha256": "4d216f52bd165559ad445eb059c5a9007b9d0bc0dc4f3e5e2aff3d4ab13cd689" }, "downloads": -1, "filename": "django_phone_confirmation-0.3.0.tar.gz", "has_sig": false, "md5_digest": "e9c9b149b8e0a73e307b76f9119b18be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8627, "upload_time": "2018-07-16T08:32:32", "url": "https://files.pythonhosted.org/packages/6f/0f/9ef48524a426bf9f30de7f08795339acc4a784626c2c0d6a5846558a68e6/django_phone_confirmation-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "c841d9f3d887da6ee93086863304ae11", "sha256": "08f821f7bb35c4ca151524034ff50000ac36d5a47eb0f9142ac8ebae084c7e98" }, "downloads": -1, "filename": "django_phone_confirmation-0.3.1.tar.gz", "has_sig": false, "md5_digest": "c841d9f3d887da6ee93086863304ae11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8625, "upload_time": "2018-07-16T10:00:32", "url": "https://files.pythonhosted.org/packages/94/4f/b379062d57a3218ed6d4869371b4e19942e0756c7cfe93e26c51cde3eb88/django_phone_confirmation-0.3.1.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "54cd81459773850b1ec380ce18476ecf", "sha256": "732cc86adffea1d6bfdfe46b4e6faf37f6a2d65874c8dbb21117d7e79cf45965" }, "downloads": -1, "filename": "django_phone_confirmation-0.3.4.tar.gz", "has_sig": false, "md5_digest": "54cd81459773850b1ec380ce18476ecf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8897, "upload_time": "2018-07-19T04:02:28", "url": "https://files.pythonhosted.org/packages/3c/33/c1af825d3bb6de4ac0189e2ed4d6e32a26398cdb3c1174f56f913baa0504/django_phone_confirmation-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "47317549177f895642791636adacd4a9", "sha256": "7b1a8ffee9fb6f2fe991c4c4de67356c49811c4f9e9a2dd0b1938d7a3035ba57" }, "downloads": -1, "filename": "django_phone_confirmation-0.3.5.tar.gz", "has_sig": false, "md5_digest": "47317549177f895642791636adacd4a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9000, "upload_time": "2018-07-19T04:30:01", "url": "https://files.pythonhosted.org/packages/b8/3e/e3879b956204062cf90f147231deb719a8d42e58468626a5242e9d62ecff/django_phone_confirmation-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "ef836c6cf1028cdd289be8f9d21a6592", "sha256": "0437db4c0dbb63d38ea14473f56e3495996120c8c9eeb66bb5ac47e80032a997" }, "downloads": -1, "filename": "django_phone_confirmation-0.3.6.tar.gz", "has_sig": false, "md5_digest": "ef836c6cf1028cdd289be8f9d21a6592", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8989, "upload_time": "2018-07-19T09:16:06", "url": "https://files.pythonhosted.org/packages/cd/99/ae323cf1bab876292d7ba69df30c6244321f3c5efa8c73ce3ea2e71fb475/django_phone_confirmation-0.3.6.tar.gz" } ], "0.3.7": [ { "comment_text": "", "digests": { "md5": "aa28f53aed7c2efd7cf6bf669b0f1a76", "sha256": "9214d4a9f7241e80417307caea3e56f423e99ba54e57348e4a77b71a11212c07" }, "downloads": -1, "filename": "django_phone_confirmation-0.3.7.tar.gz", "has_sig": false, "md5_digest": "aa28f53aed7c2efd7cf6bf669b0f1a76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9002, "upload_time": "2018-08-12T06:45:04", "url": "https://files.pythonhosted.org/packages/11/7b/c0463fde1464e9d22b744a45de02c18ccf87686464f72db88b1c4841431f/django_phone_confirmation-0.3.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aa28f53aed7c2efd7cf6bf669b0f1a76", "sha256": "9214d4a9f7241e80417307caea3e56f423e99ba54e57348e4a77b71a11212c07" }, "downloads": -1, "filename": "django_phone_confirmation-0.3.7.tar.gz", "has_sig": false, "md5_digest": "aa28f53aed7c2efd7cf6bf669b0f1a76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9002, "upload_time": "2018-08-12T06:45:04", "url": "https://files.pythonhosted.org/packages/11/7b/c0463fde1464e9d22b744a45de02c18ccf87686464f72db88b1c4841431f/django_phone_confirmation-0.3.7.tar.gz" } ] }