mbi / django-simple-captcha

Django Simple Captcha is an extremely simple, yet highly customizable Django application to add captcha images to any Django form.
http://django-simple-captcha.readthedocs.io/en/latest/
MIT License
1.38k stars 319 forks source link

Deprecation warnings on Django 3.1a1 #186

Closed jannh closed 3 years ago

jannh commented 4 years ago

When using django-simple-captcha with the latest Django 3.1a1, the following deprecation warning appears:

´´´ warnings.warn( /home/jannh/.virtualenvs/siam/lib/python3.8/site-packages/django/conf/urls/init.py:16: RemovedInDjango40Warning: django.conf.urls.url() is deprecated in favor of django.urls.re_path(). ´´´

The recommendation from Django is to use django.urls.path (or re_path, which provides the same functionality like url previously). This has however only been added in Django 2.0 - what do you think about dropping support for Django < 2.0 (and therefore also python2) and moving to the new syntax? I could contribute a PR with the necessary changes and cleanup of the six stuff.

Pyvonix commented 4 years ago

If I can take advantage of this issue to point out an other deprecation warning:

/home/user/.virtualenvs/django/lib/python3.7/site-packages/captcha/fields.py:189: RemovedInDjango40Warning: django.utils.translation.ugettext_lazy() is deprecated in favor of django.utils.translation.gettext_lazy().
  kwargs['error_messages'].update({'invalid': ugettext_lazy('Invalid CAPTCHA')})

You need to replace ugettext_lazy in fields.py by gettext_lazy.

mbi commented 3 years ago

Fixed via 8a60838, thanks!