diff --git a/.travis.yml b/.travis.yml index 3b846e5..53b1684 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,25 @@ language: python python: - - "2.7" - - "3.4" +- "2.7" env: - - TOXENV=py27-d15 - - TOXENV=py27-d16 - - TOXENV=py27-d17 - - TOXENV=py33-d17 - - TOXENV=cov +- TOXENV=py27-d16 +- TOXENV=py27-d17 +- TOXENV=py34-d17 +- TOXENV=cov branches: only: - - master - - develop + - master + - develop install: pip install --quiet --use-mirrors tox script: tox after_script: - - if [ $TOXENV == "cov" ]; then - pip install --quiet --use-mirrors coveralls; - coveralls; - fi +- if [ $TOXENV == "cov" ]; then + pip install --quiet --use-mirrors coveralls; + coveralls; + fi diff --git a/README.rst b/README.rst index 60d7c66..69afb7a 100644 --- a/README.rst +++ b/README.rst @@ -40,7 +40,7 @@ Requirements ============ - python >= 2.7 -- django >= 1.5 +- django >= 1.6 - markdown diff --git a/django_markdown/templatetags/django_markdown_static.py b/django_markdown/templatetags/django_markdown_static.py index b767dc7..8ef6876 100644 --- a/django_markdown/templatetags/django_markdown_static.py +++ b/django_markdown/templatetags/django_markdown_static.py @@ -1,17 +1,14 @@ -from django.apps import apps +from django.conf import settings from django.template import Library register = Library() -_static = None +if 'django.contrib.staticfiles' in settings.INSTALLED_APPS: + from django.contrib.staticfiles.templatetags.staticfiles import static as _static +else: + from django.templatetags.static import static as _static @register.simple_tag def static(path): - global _static - if _static is None: - if apps.is_installed('django.contrib.staticfiles'): - from django.contrib.staticfiles.templatetags.staticfiles import static as _static - else: - from django.templatetags.static import static as _static return _static(path) diff --git a/tox.ini b/tox.ini index d0fc436..b0df3bd 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py27-d15,py27-d16,py27-d17,py33-d17,cov +envlist=py27-d16,py27-d17,py34-d17,cov [pylama] skip=example/* @@ -26,12 +26,6 @@ commands=py.test deps = pytest -[testenv:py27-d15] -basepython = python2.7 -deps = - django==1.5.9 - {[testenv]deps} - [testenv:py27-d16] basepython = python2.7 deps = @@ -44,8 +38,8 @@ deps = django==1.7 {[testenv]deps} -[testenv:py33-d17] -basepython = python3.3 +[testenv:py34-d17] +basepython = python3.4 deps = django==1.7 {[testenv]deps}