You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+141-19
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,8 @@
2
2
----
3
3
4
4
This integration app implements a recaptcha field for <ahref="https://developers.google.com/recaptcha/intro">Google reCaptcha v2</a>
5
-
with explicit rendering and multiple recaptcha support.
5
+
with explicit rendering and multiple recaptcha support. The invisible version of the reCAPTCHA with the automatic render mode
6
+
is now supported, please read the related documentation below.
6
7
7
8
----
8
9
@@ -33,7 +34,7 @@ RECAPTCHA_PUBLIC_KEY = 'your public key'
33
34
34
35
If you have to create the apikey for the domains managed by your django project, you can visit this <ahref="https://www.google.com/recaptcha/admin">website</a>.
35
36
36
-
## Usage
37
+
## "I'm not a robot" Usage
37
38
### Form and Widget
38
39
You can simply create a reCaptcha enabled form with the field provided by this app:
39
40
@@ -47,7 +48,8 @@ class ExampleForm(forms.Form):
47
48
[...]
48
49
```
49
50
50
-
You can pass some parameters into the widget contructor:
51
+
You can set the private key on the "private_key" argument of the field contructor and you can pass some
52
+
parameters into the widget contructor:
51
53
52
54
```python
53
55
classReCaptchaWidget(Widget):
@@ -110,19 +112,8 @@ or
110
112
111
113
For language codes take a look to <ahref="https://developers.google.com/recaptcha/docs/language">this page</a>.
112
114
113
-
### Test unit support
114
-
You can't simulate api calls in your test, but you can disable the recaptcha field and let your test works.
115
-
116
-
Just set the RECAPTCHA_DISABLE env variable in your test:
117
-
118
-
```python
119
-
os.environ['RECAPTCHA_DISABLE'] ='True'
120
-
```
121
-
122
-
Warning: you can use any word in place of "True", the clean function will check only if the variable exists.
123
-
124
-
## Samples
125
-
### Simple render example
115
+
### Samples
116
+
#### Simple render example
126
117
127
118
Just create a form with the reCaptcha field and follow this template example:
128
119
@@ -142,7 +133,7 @@ Just create a form with the reCaptcha field and follow this template example:
142
133
</html>
143
134
```
144
135
145
-
### Explicit render example
136
+
####Explicit render example
146
137
147
138
Create a form with explicit=True and write your template like this:
148
139
@@ -163,7 +154,7 @@ Create a form with explicit=True and write your template like this:
163
154
</html>
164
155
```
165
156
166
-
### Multiple render example
157
+
####Multiple render example
167
158
168
159
You can render multiple reCaptcha using only forms with explicit=True:
169
160
@@ -189,7 +180,7 @@ You can render multiple reCaptcha using only forms with explicit=True:
189
180
</html>
190
181
```
191
182
192
-
### Mix manual render with app support
183
+
####Mix manual render with app support
193
184
194
185
You can use the app explicit render support also is you implement reCaptcha in one of your form in the template:
195
186
@@ -216,6 +207,137 @@ You can use the app explicit render support also is you implement reCaptcha in o
216
207
</html>
217
208
```
218
209
210
+
## "Invisible" Usage
211
+
The implementation and the usage of this kind of binding is simpler and you don't need to use the explicit
212
+
rendering to add multiple instances of the reCAPTCHA.
213
+
214
+
### Form and Widget
215
+
You can simply create a reCaptcha enabled form with the field provided by this app:
216
+
217
+
```python
218
+
from snowpenguin.django.recaptcha2.fields import ReCaptchaField
219
+
from snowpenguin.django.recaptcha2.widgets import ReCaptchaHiddenInput
0 commit comments