File tree 6 files changed +41
-20
lines changed
6 files changed +41
-20
lines changed Original file line number Diff line number Diff line change 1
1
FROM python:3.9
2
2
ENV PYTHONUNBUFFERED 1
3
3
ENV PYTHONPATH /code:$PYTHONPATH
4
+ RUN apt-get update && apt-get -y install flite=2.2-5
4
5
RUN mkdir /code
5
6
WORKDIR /code
6
7
COPY dev_requirements.txt /code
Original file line number Diff line number Diff line change
1
+ {% load i18n %}
2
+ {% spaceless %}
3
+ < div class ="form-group ">
4
+ < label class ="control-label "> {{ label }}</ label >
5
+ < div class ="form-group ">
6
+ < div class ="input-group mb-3 ">
7
+ < div class ="input-group-prepend ">
8
+ < img src ="{{ image }} " alt ="captcha " class ="captcha " />
9
+ {% if audio %}
10
+ < audio
11
+ title ="{% trans "Play CAPTCHA as audio file " %}"
12
+ src="{{ audio }} "
13
+ alt ="captcha audio "
14
+ controls
15
+ style ="display: block; padding-bottom: 1rem; "
16
+ >
17
+ {% endif %}
18
+ </ div >
19
+ {% include "django/forms/widgets/multiwidget.html" %}
20
+ </ div >
21
+ </ div >
22
+ </ div >
23
+ {% endspaceless %}
Original file line number Diff line number Diff line change 1
1
from allauth .account .forms import SignupForm
2
- from captcha .fields import CaptchaField
2
+ from captcha .fields import CaptchaField , CaptchaTextInput
3
3
4
4
5
- class SingupFormWithCaptcha (SignupForm ):
6
- captcha = CaptchaField ()
5
+ class CustomCaptchaTextInput (CaptchaTextInput ):
6
+ # HACK - No entiendo por qué esto apunta a community/templates y no al /templates en el root
7
+ template_name = "account/custom_captcha.html"
8
+
9
+ def image_url (self ):
10
+ # Agrego el "@2" para enviar un captcha con más resolucioón
11
+ # https://django-simple-captcha.readthedocs.io/en/latest/advanced.html#captcha-2x-image
12
+ return super ().image_url ().removesuffix ("/" ) + "@2"
13
+
14
+
15
+ class SignupFormWithCaptcha (SignupForm ):
16
+ captcha = CaptchaField (widget = CustomCaptchaTextInput )
Original file line number Diff line number Diff line change 191
191
#
192
192
CAPTCHA_LENGTH = 6
193
193
CAPTCHA_FLITE_PATH = "/usr/bin/flite"
194
- CAPTCHA_IMAGE_TEMPLATE = "account/custom_captcha.html"
195
194
196
195
ALLOWED_HTML_TAGS_INPUT = [
197
196
'a' ,
245
244
246
245
GOOGLE_TRACKING_ID = os .environ .get ('GOOGLE_TRACKING_ID' , '' )
247
246
248
- ACCOUNT_FORMS = {'signup' : 'pyarweb.forms.SingupFormWithCaptcha ' }
247
+ ACCOUNT_FORMS = {'signup' : 'pyarweb.forms.SignupFormWithCaptcha ' }
249
248
250
249
DJANGO_EASY_AUDIT_WATCH_AUTH_EVENTS = False
251
250
DJANGO_EASY_AUDIT_WATCH_REQUEST_EVENTS = False
290
289
'joboffers.publishers.telegram.TelegramPublisher' ,
291
290
'joboffers.publishers.twitter.TwitterPublisher'
292
291
]
292
+
293
+ DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ django-extensions==3.1.5
12
12
django-html-sanitizer == 0.1.5
13
13
django-model-utils == 4.2.0
14
14
django-sendfile == 0.3.11
15
- django-simple-captcha == 0.5.14
15
+ django-simple-captcha == 0.5.18
16
16
django-storages [azure ]== 1.11.1
17
17
django-summernote == 0.8.20.0
18
18
django-tagging == 0.5.0
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments