{ "info": { "author": "Pei-Wei Wu", "author_email": "peiwei.wu@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=====\ndjango-hashphrase\n=====\n\ndjango-hashphrase is a django module that facilitates the process that\nusers click on a link in an email and django handles the click.\nHashlink makes it easy to generate such a link, authenticate it or not,\ncalls a custom function or not, etc.\n\nQuick start\n-----------\n\n1. Add \"hashphrase\" to your INSTALLED_APPS setting like this::\n\n INSTALLED_APPS = (\n ...\n 'hashphrase',\n )\n\n2. Include the hashphrase URLconf in your project urls.py like this::\n\n url(r'^hl/', include('hashphrase.urls')),\n\n3. Also put this at the end of your urls.py like this::\n\n from hashphrase import hashphraseviews_autodiscover\n hashphraseviews_autodiscover() #autodiscover hashphraseviews.py in apps\n\n3. To generate a link::\n\n from hashphrase import generate_hashphrase\n\n from django.contrib.auth.models import User\n any_object = User.objects.get(id=1)\n\n import datetime\n action = 'my_click_handler'\n hash_phrase = generate_hashphrase(request.user, any_object, datetime.datetime.now(), action=action)\n\n # Then generate for example \"http://yourhost.com/hl/\"+hash_phrase+\"/\"\n # that lick will call the \"registered\" function\n\n4. To register a function, create a file called hashphraseviews.py and put the function in it.::\n\n from hashphrase import hashphrase_register\n @hashphrase_register('my_click_handler') #name must match action when creating the link\n def test_success(request, has_error, error_code, hash_link, content_obj):\n \"\"\"\n use hashphrase_register decorator to register this function to be called when\n users click on the email link.\n be sure to check has_error. If not verified, has_error = True\n See HashLink class for error code definition\n \"\"\"\n if has_error or not hash_link or not content_obj:\n from hashphrase import HashLink\n ret = \"Invalid email link.\"\n if error_code == HashLink.ERR_EXPIRED:\n ret = \"Link expired.\"\n elif error_code == HashLink.ERR_INVALID_USER:\n ret = \"Needs to login.\"\n elif error_code == HashLink.ERR_INVALID_LINK:\n ret = \"Invalid link.\"\n return HttpResponse(ret)\n return HttpResponse(\"Successful.\")", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/peiwei/django-hashlink/tarball/0.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "n/a", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-hashphrase", "package_url": "https://pypi.org/project/django-hashphrase/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-hashphrase/", "project_urls": { "Download": "https://github.com/peiwei/django-hashlink/tarball/0.1", "Homepage": "n/a" }, "release_url": "https://pypi.org/project/django-hashphrase/0.4/", "requires_dist": null, "requires_python": null, "summary": "A Django app to facilitate email links", "version": "0.4" }, "last_serial": 1316529, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a62f2be5dc28c99545d3277137508f64", "sha256": "84614e9a8675b797fa953937a28099ee1969a3d2ed305251d7b4d63873f999b4" }, "downloads": -1, "filename": "django-hashphrase-0.1.zip", "has_sig": false, "md5_digest": "a62f2be5dc28c99545d3277137508f64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12025, "upload_time": "2014-11-20T23:57:19", "url": "https://files.pythonhosted.org/packages/61/3f/40ea5707d8e49cd0e7b6aa4fd468e15b4318fb665bbc2f40576f9d8343f0/django-hashphrase-0.1.zip" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "08983db4a519b70eb21ff644f5933a97", "sha256": "7feada099116c4f2d4979660da318dba918737e0a39948f6d24cf168d3da8544" }, "downloads": -1, "filename": "django-hashphrase-0.2.zip", "has_sig": false, "md5_digest": "08983db4a519b70eb21ff644f5933a97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12137, "upload_time": "2014-11-21T01:01:20", "url": "https://files.pythonhosted.org/packages/6c/c7/508ff6383ba6f713ee3772d1e65528ae165a67384717a4d5db26a0c21266/django-hashphrase-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "3febfc35a24673bfaa02da297c5868d8", "sha256": "56f6cbaa33da72b83fde4fedb5a0ffc6720a970234f679bc62211322e4da1e08" }, "downloads": -1, "filename": "django-hashphrase-0.3.zip", "has_sig": false, "md5_digest": "3febfc35a24673bfaa02da297c5868d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12176, "upload_time": "2014-11-21T20:05:53", "url": "https://files.pythonhosted.org/packages/01/e9/831c47b128656a45e0a5add01652f71258d24485b51bff5e722d18147d9b/django-hashphrase-0.3.zip" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "f0b535f00d38c7d0f91ce0cfc25d7893", "sha256": "955614df007f62f0d319d3df8c51e69208514294c69eb409a108cd45fe88d217" }, "downloads": -1, "filename": "django-hashphrase-0.4.zip", "has_sig": false, "md5_digest": "f0b535f00d38c7d0f91ce0cfc25d7893", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12255, "upload_time": "2014-11-21T21:01:30", "url": "https://files.pythonhosted.org/packages/e6/01/cb1c7ab633bc0263b2cf5bd02dc47c384787e095a3627e40a2ee73f4773e/django-hashphrase-0.4.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f0b535f00d38c7d0f91ce0cfc25d7893", "sha256": "955614df007f62f0d319d3df8c51e69208514294c69eb409a108cd45fe88d217" }, "downloads": -1, "filename": "django-hashphrase-0.4.zip", "has_sig": false, "md5_digest": "f0b535f00d38c7d0f91ce0cfc25d7893", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12255, "upload_time": "2014-11-21T21:01:30", "url": "https://files.pythonhosted.org/packages/e6/01/cb1c7ab633bc0263b2cf5bd02dc47c384787e095a3627e40a2ee73f4773e/django-hashphrase-0.4.zip" } ] }