mirror of
https://github.com/jazzband/django-axes.git
synced 2026-03-16 22:30:23 +00:00
Add six imports for Django master compatibility
Implement forwards compatibility for missing django.utils.six package imports on Django 2.2 Relates to django-compressor/django-appconf#44 and can be removed after django-appconf has received a new release which deprecates the use of the integrated Django six library Signed-off-by: Aleksi Häkli <aleksi.hakli@iki.fi>
This commit is contained in:
parent
fc32a00e50
commit
d4c2603ed7
2 changed files with 12 additions and 1 deletions
10
axes/conf.py
10
axes/conf.py
|
|
@ -1,3 +1,13 @@
|
|||
# TODO: Remove these imports after django-appconf does not depend on django.utils.six
|
||||
try:
|
||||
from django.utils import six # noqa
|
||||
except ImportError: # pragma: no cover
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
sys.modules['django.utils.six'] = __import__('six')
|
||||
warnings.warn('django.utils.six was patched for django-appconf backwards compatibility', ImportWarning)
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
|
|
|||
3
setup.py
3
setup.py
|
|
@ -34,10 +34,11 @@ setup(
|
|||
package_dir={'axes': 'axes'},
|
||||
python_requires='~=3.5',
|
||||
install_requires=[
|
||||
'pytz',
|
||||
'django',
|
||||
'django-appconf',
|
||||
'django-ipware>=2.0.2',
|
||||
'pytz',
|
||||
'six',
|
||||
],
|
||||
include_package_data=True,
|
||||
packages=find_packages(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue