Skip to content

Commit

Permalink
Fix compatibility with Django 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Aug 2, 2018
1 parent b1d92cf commit fbb0ff8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ matrix:
python: 3.5
- env: TOXENV=py36-dj20
python: 3.6
- env: TOXENV=py36-dj21
python: 3.6
- env: TOXENV=py36-djmaster
python: 3.6
allow_failures:
Expand Down
13 changes: 10 additions & 3 deletions configurations/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,16 @@ def name(self):
return os.environ.get(self.namevar)

def check_options(self):
parser = base.CommandParser(None,
usage="%(prog)s subcommand [options] [args]",
add_help=False)
try:
parser = base.CommandParser(
usage="%(prog)s subcommand [options] [args]",
add_help=False)
except TypeError:
# Django before 2.1 used a `cmd` argument.
parser = base.CommandParser(
None,
usage="%(prog)s subcommand [options] [args]",
add_help=False)
parser.add_argument('--settings')
parser.add_argument('--pythonpath')
parser.add_argument(CONFIGURATION_ARGUMENT,
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ envlist =
flake8-py36,
readme-py27,
py{27,34,35,36,py}-dj{18,110,111}
py{34,35,36}-dj{20,master}
py{34,35,36,37}-dj20
py{35,36,37}-dj{21,master}

[testenv]
usedevelop = true
Expand All @@ -21,6 +22,7 @@ deps =
dj110: django>=1.10,<1.11
dj111: django>=1.11,<2.0
dj20: django>=2.0a1,<2.1
dj21: django>=2.1a1,<2.2
djmaster: https://github.com/django/django/archive/master.tar.gz#egg=django

commands =
Expand Down

2 comments on commit fbb0ff8

@codingjoe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blueyed should we tag a new release?

@blueyed
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codingjoe
Needs a changelog still.

Please sign in to comment.