summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2015-06-10 20:19:21 +0200
committerMarkus Holtermann <info@markusholtermann.eu>2015-06-11 16:38:12 +0200
commit5d428908218e3692d1bc7e4ada6235029ae9e45c (patch)
treec125198a5277e0145cdbbb27afe50cdb711bd648 /django
parent339c01fb7552feb8df125ef7e5420dae04fd913f (diff)
Fixed #24950 -- Added unicode_literals to models.py in app template
Thanks Tim Graham for the patch
Diffstat (limited to 'django')
-rw-r--r--django/conf/app_template/models.py2
-rw-r--r--django/core/management/templates.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/django/conf/app_template/models.py b/django/conf/app_template/models.py
index 71a8362390..7a54b3e371 100644
--- a/django/conf/app_template/models.py
+++ b/django/conf/app_template/models.py
@@ -1,3 +1,3 @@
-from django.db import models
+{{ unicode_literals }}from django.db import models
# Create your models here.
diff --git a/django/core/management/templates.py b/django/core/management/templates.py
index eb5340dc88..2aa9b021a2 100644
--- a/django/core/management/templates.py
+++ b/django/core/management/templates.py
@@ -14,7 +14,7 @@ import django
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import handle_extensions
from django.template import Context, Engine
-from django.utils import archive
+from django.utils import archive, six
from django.utils.six.moves.urllib.request import urlretrieve
from django.utils.version import get_docs_version
@@ -104,6 +104,7 @@ class TemplateCommand(BaseCommand):
base_directory: top_dir,
'docs_version': get_docs_version(),
'django_version': django.__version__,
+ 'unicode_literals': '' if six.PY3 else 'from __future__ import unicode_literals\n\n',
}), autoescape=False)
# Setup a stub settings environment for template rendering