This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
=====
django-hashphrase
=====

django-hashphrase is a django module that facilitates the process that
users click on a link in an email and django handles the click.
Hashlink makes it easy to generate such a link, authenticate it or not,
calls a custom function or not, etc.

Quick start
-----------

1. Add "hashphrase" to your INSTALLED_APPS setting like this::

INSTALLED_APPS = (
...
'hashphrase',
)

2. Include the hashphrase URLconf in your project urls.py like this::

url(r'^hl/', include('hashphrase.urls')),

3. Also put this at the end of your urls.py like this::

from hashphrase import hashphraseviews_autodiscover
hashphraseviews_autodiscover() #autodiscover hashphraseviews.py in apps

3. To generate a link::

from hashphrase import generate_hashphrase

from django.contrib.auth.models import User
any_object = User.objects.get(id=1)

import datetime
action = 'my_click_handler'
hash_phrase = generate_hashphrase(request.user, any_object, datetime.datetime.now(), action=action)

# Then generate for example "http://yourhost.com/hl/"+hash_phrase+"/"
# that lick will call the "registered" function

4. To register a function, create a file called hashphraseviews.py and put the function in it.::

from hashphrase import hashphrase_register
@hashphrase_register('my_click_handler') #name must match action when creating the link
def test_success(request, has_error, error_code, hash_link, content_obj):
"""
use hashphrase_register decorator to register this function to be called when
users click on the email link.
be sure to check has_error. If not verified, has_error = True
See HashLink class for error code definition
"""
if has_error or not hash_link or not content_obj:
from hashphrase import HashLink
ret = "Invalid email link."
if error_code == HashLink.ERR_EXPIRED:
ret = "Link expired."
elif error_code == HashLink.ERR_INVALID_USER:
ret = "Needs to login."
elif error_code == HashLink.ERR_INVALID_LINK:
ret = "Invalid link."
return HttpResponse(ret)
return HttpResponse("Successful.")
Release History

Release History

0.4

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-hashphrase-0.4.zip (12.3 kB) Copy SHA256 Checksum SHA256 Source Nov 21, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting