Giter Site home page Giter Site logo

supercaptcha's Introduction

supercaptcha

supercaptcha is easy to use captcha field for django

usage

class MySuperForm(forms.Form):

    captcha = supercaptcha.CaptchaField(label=u"no robots here")

requirements

You don't need any changes in form, or middleware or context processor or other mess

All you need, to get captcha working is properly configured cache backend and a route:

url(r'^captcha/(?P<code>[\da-f]{32})/$', 'supercaptcha.draw')

And PIL installed

configuration

All these options should be used in settings of your project

CAPTCHA_SYMBOLS

string with all symbols, which should be used in captcha, default is '123456789ABCDEFGHJKLMNPQRSTVXYZ'

CAPTCHA_LENGTH

length if captcha code, default is 6

CAPTCHA_FONTS

the tuple of tuples with name - fullpath pair for each font which should be used

CAPTCHA_FOREGROUND_COLORS

tuple of tuples with colors for text. use one if if you want single color, for example ((0,0,0),) for black color

CAPTCHA_COLORIZE_SYMBOLS

whould we use different colors for each symbol default is True

CAPTCHA_BACKGROUND_COLOR

background color, deafult is (255, 255, 255)

CAPTCHA_FILTER_CHAIN

PIL filters, for example ('BLUR', 'SHARPEN',) default is []

CAPTCHA_VERTICAL_JUMP

defines if letters should "jump", default is True

CAPTCHA_SIZE

tuple defining size of captcha image, default is (200, 100)

CAPTCHA_ALT

"alt" for image tag, default is 'no robots here'

CAPTCHA_FORMAT

controls which format will be used for image encoding, default is ('JPEG', 'image/jpeg')

CAPTCHA_CACHE_PREFIX

defines which prefix should supercaptcha use for dealing with cache, default is 'captcha'

CAPTCHA_DEFAULT_ERROR_MESSAGE

defines default error message for wrong code

CAPTCHA_REFRESH

defines if CaptchaField should show refresh link, default is False

CAPTCHA_REFRESH_LINK_TEXT

defines text of refresh link

CAPTCHA_HTML_TEMPLATE

defines template of CaptchaField, see example in settings

CAPTCHA_HTML_TEMPLATE_WITH_REFRESH

defines template of CaptchaField with refresh link, see example in settings

changelog

  • 0.2.0 compability with django 1.7

  • 0.1.4 forked version

supercaptcha's People

Contributors

barbuza avatar mr-africa avatar suvit avatar

Watchers

James Cloos avatar  avatar

Forkers

limeschnaps

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.