Simple way to add a ReCaptcha_ field to your admin login page.
-
Install django-captcha-admin
from pypi::
$> pip install django-captcha-admin
-
Add captcha_admin
and captcha
to your INSTALLED_APPS
::
INSTALLED_APPS = (
...
'captcha_admin',
'captcha',
)
-
Add your captcha keys to your settings, the way django-recaptcha_
indicates::
RECAPTCHA_PUBLIC_KEY = 'your-public-key'
RECAPTCHA_PRIVATE_KEY = 'your-private-key'
-
Edit your code so instead of importing admin
from
django.contrib
, you import it from captcha_admin
::
from captcha_admin import admin
This should stay the same
admin.autodiscover()
urlpatterns = patterns(
...
url(r'^admin/', include(admin.site.urls)), # and this...
...
)