Merge pull request #1 from jezdez/develop-1.4

Develop 1.4
This commit is contained in:
Michael Kutý 2015-08-25 10:49:50 +02:00
commit db74e84604
5 changed files with 10 additions and 4 deletions

View file

@ -13,7 +13,6 @@ script:
- coverage run --branch --source=dbtemplates `which django-admin.py` test dbtemplates
- coverage report --omit="dbtemplates/test*,dbtemplates/migrations*"
env:
- DJANGO=1.3.7
- DJANGO=1.4.5
- DJANGO=1.5.1
- DJANGO=1.7.8

View file

@ -2,6 +2,7 @@ import posixpath
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
from django.utils.six import string_types
from appconf import AppConf
@ -31,7 +32,7 @@ class DbTemplatesConf(AppConf):
return "dbtemplates"
else:
return "default"
if isinstance(value, basestring) and value.startswith("dbtemplates."):
if isinstance(value, string_types) and value.startswith("dbtemplates."):
raise ImproperlyConfigured("Please upgrade to one of the "
"supported backends as defined "
"in the Django docs.")

View file

@ -4,6 +4,10 @@ from optparse import make_option
from django import VERSION
from django.contrib.sites.models import Site
from django.core.management.base import CommandError, NoArgsCommand
try:
from django.utils.six import input as raw_input
except ImportError:
pass
from dbtemplates.conf import settings
from dbtemplates.models import Template

View file

@ -60,6 +60,6 @@ def get_template_source(name):
def check_template_syntax(template):
try:
Template(template.content)
except TemplateSyntaxError, e:
except TemplateSyntaxError as e:
return (False, e)
return (True, None)

View file

@ -5,7 +5,9 @@ from setuptools import setup, find_packages
def read(*parts):
return codecs.open(os.path.join(os.path.dirname(__file__), *parts)).read()
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()
def find_version(*file_paths):