mirror of
https://github.com/jazzband/django-dbtemplates.git
synced 2026-03-16 22:20:28 +00:00
Fix some Python 3 issues - thanks @vikingco
This commit is contained in:
parent
fbc2891c41
commit
c8a048352e
3 changed files with 7 additions and 2 deletions
|
|
@ -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.")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue