setup(
name='django-ssify',
- version='0.2.1',
+ version='0.2.2',
author='Radek Czajka',
author_email='radekczajka@nowoczesnapolska.org.pl',
url='http://git.mdrn.pl/django-ssify.git',
"Programming Language :: Python :: 3.4",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Code Generators",
- ]
+ ],
+ zip_safe=False,
)
import functools
from inspect import getargspec
import warnings
+from django.conf import settings
+from django.http import Http404
from django.template.base import parse_bits
from django.utils.translation import get_language, activate
from .cache import cache_include, DEFAULT_TIMEOUT
lang = kwargs.pop('lang')
except KeyError:
raise exceptions.NoLangFieldError(request)
+ if lang not in [language[0] for language in settings.LANGUAGES]:
+ raise Http404
current_lang = get_language()
activate(lang)
request.LANGUAGE_CODE = lang
#
[tox]
envlist=clear,
- d15-py26, d15-py27, d15-py32, d15-py33,
- d16-py26, d16-py27, d16-py32, d16-py33,
- d17-py27, d17-py32, d17-py33, d17-py34,
- dd-py27, dd-py32, dd-py33, dd-py34,
+ d1{5,6}-py{26,27,32,33},
+ d{17,d}-py{27,32,33,34},
stats
[testenv]
-indexserver=http://py.mdrn.pl
+indexserver=https://py.mdrn.pl:8443
commands=coverage run --source=ssify --append --branch runtests.py
-deps=coverage
+deps=
+ d15: Django>=1.5,<1.6
+ d16: Django>=1.6,<1.7
+ d17: Django>=1.7,<1.8
+ dd: https://github.com/django/django/zipball/master
+ coverage
+basepython=
+ py26: python2.6
+ py27: python2.7
+ py32: python3.2
+ py33: python3.3
+ py34: python3.4
[testenv:clear]
+basepython=python3.4
commands=coverage erase
[testenv:stats]
-commands=coverage html
-
-[base]
-
-[testenv:d15-py26]
-basepython=python2.6
-deps=
- Django>=1.5,<1.6
- {[testenv]deps}
-
-[testenv:d15-py27]
-basepython=python2.7
-deps=
- Django>=1.5,<1.6
- {[testenv]deps}
-
-[testenv:d15-py32]
-basepython=python3.2
-deps=
- Django>=1.5,<1.6
- {[testenv]deps}
-
-[testenv:d15-py33]
-basepython=python3.3
-deps=
- Django>=1.5,<1.6
- {[testenv]deps}
-
-[testenv:d16-py26]
-basepython=python2.6
-deps=
- Django>=1.6,<1.7
- {[testenv]deps}
-
-[testenv:d16-py27]
-basepython=python2.7
-deps=
- Django>=1.6,<1.7
- {[testenv]deps}
-
-[testenv:d16-py32]
-basepython=python3.2
-deps=
- Django>=1.6,<1.7
- {[testenv]deps}
-
-[testenv:d16-py33]
-basepython=python3.3
-deps=
- Django>=1.6,<1.7
- {[testenv]deps}
-
-[testenv:d17-py27]
-basepython=python2.7
-deps=
- https://www.djangoproject.com/download/1.7c3/tarball/
- {[testenv]deps}
-
-[testenv:d17-py32]
-basepython=python3.2
-deps=
- Django>=1.7,<1.8
- {[testenv]deps}
-
-[testenv:d17-py33]
-basepython=python3.3
-deps=
- Django>=1.7,<1.8
- {[testenv]deps}
-
-[testenv:d17-py34]
basepython=python3.4
-deps=
- Django>=1.7,<1.8
- {[testenv]deps}
-
-[testenv:dd-py27]
-basepython=python2.7
-deps=
- https://github.com/django/django/zipball/master
- {[testenv]deps}
-
-[testenv:dd-py32]
-basepython=python3.2
-deps=
- https://github.com/django/django/zipball/master
- {[testenv]deps}
-
-[testenv:dd-py33]
-basepython=python3.3
-deps=
- https://github.com/django/django/zipball/master
- {[testenv]deps}
+commands=coverage html
-[testenv:dd-py34]
-basepython=python3.4
-deps=
- https://github.com/django/django/zipball/master
- {[testenv]deps}