Python Library Installation Instructions

Downloads

Download Python Files (tar.gz) Download Python Files (zip)

Description

The Are You a Human Python library allows you to easily add a PlayThru; CAPTCHA alternative to forms on your website.

Installation

The AYAH Python Integration Library is compatible with Python 2.x and 3.x. (It was built and tested on versions 2.7.x and 3.2.x.) Python 3.x requires an extra installation step as described below.

Python 2.x Installation:

  • Download and extract the appropriate source distribution for your OS.
  • Install the package:
    python setup.py install

Python 3.x Installation:

  • Download and extract the appropriate source distribution for your OS.
  • Convert the package to Python 3.x
    2to3 -wn ./ayah
  • Install the package:
    python3 setup.py install

Integration

The AYAH Python Integration Library is compatible with all web application frameworks.

  • Get your publisher key and scoring key from dashboard.
  • Import the ayah module:
    import ayah
  • Configure the ayah module when your application initializes:
    ayah.configure(<your-publisher-key>, <your-scoring-key>)
  • Display the AYAH HTML on any page that requires a human:
    html = ayah.get_publisher_html()
    Django: you can pass this HTML to the view through the context or simply call get_publisher_html() in the template.
  • Allow the alleged human to complete the PlayThru; challenge. When they're finished, your web page will have a hidden field on it with id="session_secret".
  • Use the value of the hidden session secret field to determine if the alleged human passed the challenge:
    passed = ayah.score_result(<session-secret>)
    Django: the hidden field will be available in your form object:
    ifrequest.method == 'POST':
    	form = LoginForm(request.POST)
    	ifform.is_valid():
    	secret = form.cleaned_data['session_secret']
    	passed = ayah.score_result(secret)
    	# Redirect...
    

Congratulations, your application detects humans without requiring CAPTCHA!

Troubleshooting

If PlayThru isn't loading for you, please check the following:

  • If PlayThru is set to "Lightbox" mode, it will only display once the form it's included in has been submitted. You can see which mode PlayThru is set to in the "Game Style" section of the Dashboard.
  • Make sure that you are using the correct publisher key and scoring key.
  • Check to see if your server and/or network has a firewall which prevents outbound connections via port 443.

If you need further support, head on over to our Support Center. We'd be more than happy to help you out!

Installation Support

If you run into any issues during your installation process please use our support forums. We appreciate all feedback and are ready to help! Follow us on Twitter and Facebook for PlayThru™ updates.

License and Distribution

Copyright © 2011 AYAH LLC http://www.areyouahuman.com

BY USING THIS SOFTWARE YOU AGREE TO THE TERMS AND CONDITIONS FOUND AT: terms_of_service.