From b69769d71a99806a69e300eca0d7c6744a2b327e Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 12 Dec 2015 13:51:59 +0100 Subject: [PATCH] Django 1.9 compatibility --- .travis.yml | 2 ++ README.rst | 1 + cas_server/models.py | 2 +- cas_server/utils.py | 2 +- setup.py | 4 ++-- tox.ini | 14 ++++++++++++++ 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3d9d10c..b0bdd46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,10 @@ env: matrix: - TOX_ENV=py27-django17 - TOX_ENV=py27-django18 + - TOX_ENV=py27-django19 - TOX_ENV=py34-django17 - TOX_ENV=py34-django18 + - TOX_ENV=py34-django19 - TOX_ENV=flake8 cache: directories: diff --git a/README.rst b/README.rst index 6d7bd9c..32ce1dc 100644 --- a/README.rst +++ b/README.rst @@ -22,6 +22,7 @@ Quick start INSTALLED_APPS = ( ... + 'bootstrap3', 'cas_server', ) diff --git a/cas_server/models.py b/cas_server/models.py index 8424d3a..de3377f 100644 --- a/cas_server/models.py +++ b/cas_server/models.py @@ -38,7 +38,7 @@ class User(models.Model): unique_together = ("username", "session_key") session_key = models.CharField(max_length=40, blank=True, null=True) username = models.CharField(max_length=30) - date = models.DateTimeField(auto_now_add=True, auto_now=True) + date = models.DateTimeField(auto_now=True) @classmethod def clean_old_entries(cls): diff --git a/cas_server/utils.py b/cas_server/utils.py index a4ae87f..24127b3 100644 --- a/cas_server/utils.py +++ b/cas_server/utils.py @@ -12,7 +12,6 @@ """Some util function for the app""" from .default_settings import settings -from django.utils.importlib import import_module from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse from django.contrib import messages @@ -20,6 +19,7 @@ from django.contrib import messages import random import string import json +from importlib import import_module try: from urlparse import urlparse, urlunparse, parse_qsl diff --git a/setup.py b/setup.py index 416e833..df5360b 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-cas-server', - version='0.2.1', + version='0.3', packages=['cas_server'], include_package_data=True, license='GPLv3', @@ -37,7 +37,7 @@ setup( ] }, keywords=['django', 'cas', 'cas3', 'server', 'sso', 'single sign-on', 'authentication', 'auth'], - install_requires=['Django >= 1.7', 'requests >= 2.4', 'requests_futures >= 0.9.5', + install_requires=['Django >= 1.7,<1.10', 'requests >= 2.4', 'requests_futures >= 0.9.5', 'django-picklefield >= 0.3.1', 'django-bootstrap3 >= 5.4', 'lxml >= 3.4'], url="https://github.com/nitmir/django-cas-server", download_url="https://github.com/nitmir/django-cas-server/releases", diff --git a/tox.ini b/tox.ini index ea1e77e..997620a 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,10 @@ envlist= py27-django17, py27-django18, + py27-django19, py34-django17, py34-django18, + py34-django19, flake8, [flake8] @@ -29,6 +31,12 @@ deps = Django>=1.8,<1.9 {[base]deps} +[testenv:py27-django19] +basepython=python2.7 +deps = + Django>=1.9,<1.10 + {[base]deps} + [testenv:py34-django17] basepython=python3.4 deps = @@ -41,6 +49,12 @@ deps = Django>=1.8,<1.9 {[base]deps} +[testenv:py34-django19] +basepython=python3.4 +deps = + Django>=1.9,<1.10 + {[base]deps} + [testenv:flake8] basepython=python deps=flake8