Skip to content

Commit

Permalink
Django 1.7 (beta) and Python 3.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Bouke committed Apr 13, 2014
1 parent 642dd60 commit 761a0d6
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ contains the package `django-two-factor-auth`_, but that application is not a
dependency for this package. Also have a look at the bundled example templates
and views to see how you can integrate the application into your project.

Compatible with Django 1.4, 1.5 and 1.6 on Python 2.6, 2.7, 3.2 and 3.3.
Documentation is available at `readthedocs.org`_.
Compatible with Django 1.4, 1.5, 1.6 and 1.7 on Python 2.6, 2.7, 3.2, 3.3 and
3.4. Documentation is available at `readthedocs.org`_.


Features
Expand Down Expand Up @@ -60,7 +60,7 @@ Installation
4. Add ``SESSION_ENGINE = 'user_sessions.backends.db'``.
5. Add ``url(r'', include('user_sessions.urls', 'user_sessions')),`` to your
``urls.py``.
6. Run ``python manage.py syncdb`` (or ``migrate``) and browse to
6. Run ``python manage.py syncdb`` (or ``migrate``) and browse to
``/account/sessions/``.

GeoIP
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Release Notes

0.1.4
-----
* Python 3.4 support
* Django 1.7 (beta) support
* Italian translation added (thanks to joke2k)
* Chinese translation added (thanks to mozillazg)
* Arabic translation updated (thanks to Bashar Al-Abdulhadi)
Expand Down
4 changes: 2 additions & 2 deletions example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
#'django.contrib.sessions',
# 'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'south',
Expand Down Expand Up @@ -73,7 +73,7 @@

STATIC_URL = '/static/'

## CUSTOM
# Custom configuration

TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Security',
],
)
9 changes: 7 additions & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
except ImportError:
from urllib import urlencode

import django
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.models import User
from django.contrib.sessions.backends.base import CreateError
from django.core.urlresolvers import reverse
from django.db import IntegrityError

from django.test import TestCase
from django.test.utils import override_settings
from django.utils.timezone import now
Expand Down Expand Up @@ -50,8 +50,13 @@ def test_modify_session(self):
self.assertEqual(session.ip, '127.0.0.1')

def test_login(self):
if django.VERSION < (1, 7):
admin_login_url = '/admin/'
else:
admin_login_url = reverse('admin:login')

user = User.objects.create_superuser('bouke', '', 'secret')
response = self.client.post('/admin/',
response = self.client.post(admin_login_url,
data={
'username': 'bouke',
'password': 'secret',
Expand Down
42 changes: 42 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ envlist =
py27-django15,
py32-django15,
py33-django15,
py34-django15,
py26-django16,
py27-django16,
py32-django16,
py33-django16,
py34-django16,
py27-django17,
py32-django17,
py33-django17,
py34-django17,
flake8

[testenv]
Expand Down Expand Up @@ -53,6 +59,12 @@ deps =
Django>=1.5,<1.6
{[testenv]deps}

[testenv:py34-django15]
basepython = python3.4
deps =
Django>=1.5,<1.6
{[testenv]deps}

[testenv:py26-django16]
basepython = python2.6
deps =
Expand All @@ -77,6 +89,36 @@ deps =
Django>=1.6,<1.7
{[testenv]deps}

[testenv:py34-django16]
basepython = python3.4
deps =
Django>=1.6,<1.7
{[testenv]deps}

[testenv:py27-django17]
basepython = python2.7
deps =
https://www.djangoproject.com/download/1.7b1/tarball/
{[testenv]deps}

[testenv:py32-django17]
basepython = python3.2
deps =
https://www.djangoproject.com/download/1.7b1/tarball/
{[testenv]deps}

[testenv:py33-django17]
basepython = python3.3
deps =
https://www.djangoproject.com/download/1.7b1/tarball/
{[testenv]deps}

[testenv:py34-django17]
basepython = python3.4
deps =
https://www.djangoproject.com/download/1.7b1/tarball/
{[testenv]deps}

[testenv:flake8]
commands = make flake8
deps =
Expand Down

0 comments on commit 761a0d6

Please sign in to comment.