Skip to content

Commit

Permalink
Add support for django 3.1, remove python2 deprecations, add badges t…
Browse files Browse the repository at this point in the history
…o readme
  • Loading branch information
nezhar committed Oct 3, 2020
1 parent b533c29 commit 9913a09
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 47 deletions.
31 changes: 9 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,25 @@
sudo: false
language: python
dist: xenial # default is ubuntu 14.04, we need at least 16.04
python: # test various python versions (Django Support for various python versions is described within the exclude: section)
- "2.7"
- "3.4"
python: # test various python versions
- "3.5"
- "3.6"
- "3.7"
- "pypy" # PyPy2
- "pypy3" # PyPy3
- "3.8"
- "pypy3"
env:
- DJANGO=1.11
- DJANGO=2.0
- DJANGO=2.1
- DJANGO=2.2
- DJANGO=3.0
- DJANGO=3.1
- DJANGO=master
matrix:
exclude:
# Django >= 2.0 does not support Python2.7/PyPy2 anymore
- { python: "2.7", env: DJANGO=2.0 }
- { python: "pypy", env: DJANGO=2.0 }
- { python: "2.7", env: DJANGO=2.1 }
- { python: "pypy", env: DJANGO=2.1 }
- { python: "2.7", env: DJANGO=2.2 }
- { python: "pypy", env: DJANGO=2.2 }
- { python: "2.7", env: DJANGO=master }
- { python: "pypy", env: DJANGO=master }
# Django >= 2.1 does not support Python3.4 anymore
- { python: "3.4", env: DJANGO=2.1 }
- { python: "3.4", env: DJANGO=2.2 }
- { python: "3.4", env: DJANGO=master }
# Django >= 3.0 does not support Python3.5 anymore
- { python: "3.5", env: DJANGO=3.0 }
- { python: "3.5", env: DJANGO=3.1 }
- { python: "3.5", env: DJANGO=master }
allow_failures:
# newer python versions aswell as pypy may also always break our build
- python: "pypy"
- python: "pypy3"
- env: DJANGO=master
cache:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 1.4.0 - unreleased

- Added Django 3.0 support
- Added Django 3.1 support
- Removed Django 1.11 support
- Removed Django 2.0 support
- Removed Python 2.7 support
- Removed Python 3.4 support

## 1.3.3

- Removes python requires classifier

## 1.3.2

- Fixes installation for older python versions
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Django Rest Multi Token Auth

[![PyPI](https://img.shields.io/pypi/v/django-rest-multitokenauth)](https://pypi.org/project/django-rest-multitokenauth/)
[![Build Status](https://travis-ci.org/anexia-it/django-rest-multiauthtoken.svg?branch=master)](https://travis-ci.org/anexia-it/django-rest-multiauthtoken)

This django app is an extension for the Django Rest Framework (Version 3.4+).
It tries to overcome the limitation of Token Authentication, which only uses a single
token per user.
Expand Down Expand Up @@ -89,9 +92,12 @@ If your project uses an older verison of Django or Django Rest Framework, you ca

| This Project | Python Version | Django Version | Django Rest Framework |
|--------------|----------------|----------------|-----------------------|
| 1.4.* | 3.5+ | 2.1+, 3.0+ | 3.8, 3.9, 3.10 |
| 1.3.* | 2.7, 3.4+ | 1.11, 2.0+ | 3.6, 3.7, 3.8 |
| 1.2.* | 2.7, 3.4+ | 1.8, 1.11, 2.0+| 3.6, 3.7, 3.8 |

Make sure to use at least `DRF 3.10` when using `Django 3.0` or newer.


## Changelog / Releases

Expand Down
2 changes: 0 additions & 2 deletions django_rest_multitokenauth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from rest_framework.authtoken.models import Token
from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _

__all__ = [
Expand All @@ -18,7 +17,6 @@
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')


@python_2_unicode_compatible
class MultiToken(models.Model):
"""
The multi token model with user agent and IP address.
Expand Down
11 changes: 4 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def run(self):
version=VERSION,
packages=find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
install_requires=[
'django-ipware==2.1.*',
'django-ipware==3.0.*',
],
include_package_data=True,
license='BSD License',
Expand All @@ -68,21 +68,18 @@ def run(self):
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
Expand Down
28 changes: 12 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
[tox]
envlist =
{py27,py34,py35,py36,pypy,pypy3}-django111-{drf35,drf36,drf37,drf38,drf39},
{py34,py35,py36,pypy3}-django20-{drf37,drf38,drf39},
{py35,py36,py37,pypy3}-django21-{drf37,drf38,drf39},
{py35,py36,py37,pypy3}-django22-{drf38,drf39},
{py35,py36,py37,pypy3}-djangomaster-{drf38,drf39}
{py35,py36,py37,py38,pypy3}-django22-{drf39,drf310,drf311},
{py36,py37,py38,pypy3}-django30-{drf310,drf311},
{py36,py37,py38,pypy3}-django30-{drf310,drf311},
{py36,py37,py38,pypy3}-django31-{drf311},
{py36,py37,py38,pypy3}-djangomaster-{drf311}

[travis:env]
DJANGO =
1.11: django111
2.0: django20
2.1: django21
2.2: django22
3.0: django30
3.1: django31
master: djangomaster

[testenv]
Expand All @@ -23,13 +22,10 @@ setenv =
PYTHONWARNINGS=once
deps =
mock==2.0
drf35: djangorestframework>=3.5,<3.6
drf36: djangorestframework>=3.6,<3.7
drf37: djangorestframework>=3.7,<3.8
drf38: djangorestframework>=3.8,<3.9
drf39: djangorestframework>=3.9,<3.10
django111: Django>=1.11,<2.0
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<3.0
drf310: djangorestframework>=3.10,<3.11
drf311: djangorestframework>=3.11,<3.12
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
djangomaster: https://github.com/django/django/archive/master.tar.gz

0 comments on commit 9913a09

Please sign in to comment.