summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-11-19 18:19:41 +0100
committerClaude Paroz <claude@2xlibre.net>2017-01-18 09:55:19 +0100
commitd7b9aaa366dd54ecc3142c588162e3adc7c2f7ac (patch)
treec7faf11a6f6c14981a08a621c36e6f736b21dd8b /docs
parent397b3705c5f762b359cdb494f9447c8a60685adf (diff)
Refs #23919 -- Removed encoding preambles and future imports
Diffstat (limited to 'docs')
-rw-r--r--docs/conf.py4
-rw-r--r--docs/howto/writing-migrations.txt6
-rw-r--r--docs/ref/files/file.txt1
-rw-r--r--docs/ref/migration-operations.txt3
-rw-r--r--docs/topics/i18n/formatting.txt2
-rw-r--r--docs/topics/migrations.txt26
-rw-r--r--docs/topics/templates.txt2
7 files changed, 0 insertions, 44 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 1643559a1d..13a6dbd67e 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
@@ -11,8 +9,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-from __future__ import unicode_literals
-
import sys
from os.path import abspath, dirname, join
diff --git a/docs/howto/writing-migrations.txt b/docs/howto/writing-migrations.txt
index 35964f7ce8..02579eeeb4 100644
--- a/docs/howto/writing-migrations.txt
+++ b/docs/howto/writing-migrations.txt
@@ -100,10 +100,7 @@ the respective field according to your needs.
.. snippet::
:filename: 0006_remove_uuid_null.py
- # -*- coding: utf-8 -*-
# Generated by Django A.B on YYYY-MM-DD HH:MM
- from __future__ import unicode_literals
-
from django.db import migrations, models
import uuid
@@ -154,10 +151,7 @@ the respective field according to your needs.
.. snippet::
:filename: 0005_populate_uuid_values.py
- # -*- coding: utf-8 -*-
# Generated by Django A.B on YYYY-MM-DD HH:MM
- from __future__ import unicode_literals
-
from django.db import migrations, models
import uuid
diff --git a/docs/ref/files/file.txt b/docs/ref/files/file.txt
index 6c218e38b3..4169b74b88 100644
--- a/docs/ref/files/file.txt
+++ b/docs/ref/files/file.txt
@@ -111,7 +111,6 @@ The ``ContentFile`` class
but unlike :class:`~django.core.files.File` it operates on string content
(bytes also supported), rather than an actual file. For example::
- from __future__ import unicode_literals
from django.core.files.base import ContentFile
f1 = ContentFile("esta sentencia está en español")
diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt
index 7e5f4d4784..e6e6f73a99 100644
--- a/docs/ref/migration-operations.txt
+++ b/docs/ref/migration-operations.txt
@@ -310,9 +310,6 @@ class in the migration file, and just pass it to ``RunPython``. Here's an
example of using ``RunPython`` to create some initial objects on a ``Country``
model::
- # -*- coding: utf-8 -*-
- from __future__ import unicode_literals
-
from django.db import migrations, models
def forwards_func(apps, schema_editor):
diff --git a/docs/topics/i18n/formatting.txt b/docs/topics/i18n/formatting.txt
index 248d6b0d23..4a0ce6d3e8 100644
--- a/docs/topics/i18n/formatting.txt
+++ b/docs/topics/i18n/formatting.txt
@@ -177,8 +177,6 @@ To customize the English formats, a structure like this would be needed::
where :file:`formats.py` contains custom format definitions. For example::
- from __future__ import unicode_literals
-
THOUSAND_SEPARATOR = '\xa0'
to use a non-breaking space (Unicode ``00A0``) as a thousand separator,
diff --git a/docs/topics/migrations.txt b/docs/topics/migrations.txt
index e8675fe545..5475e7b385 100644
--- a/docs/topics/migrations.txt
+++ b/docs/topics/migrations.txt
@@ -454,10 +454,7 @@ the file in the right place, suggest a name, and add dependencies for you)::
Then, open up the file; it should look something like this::
- # -*- coding: utf-8 -*-
# Generated by Django A.B on YYYY-MM-DD HH:MM
- from __future__ import unicode_literals
-
from django.db import migrations, models
class Migration(migrations.Migration):
@@ -485,9 +482,6 @@ combined values of ``first_name`` and ``last_name`` (we've come to our senses
and realized that not everyone has first and last names). All we
need to do is use the historical model and iterate over the rows::
- # -*- coding: utf-8 -*-
- from __future__ import unicode_literals
-
from django.db import migrations, models
def combine_names(apps, schema_editor):
@@ -757,26 +751,6 @@ The decorator adds logic to capture and preserve the arguments on their
way into your constructor, and then returns those arguments exactly when
deconstruct() is called.
-Supporting Python 2 and 3
-=========================
-
-In order to generate migrations that support both Python 2 and 3, all string
-literals used in your models and fields (e.g. ``verbose_name``,
-``related_name``, etc.), must be consistently either bytestrings or text
-(unicode) strings in both Python 2 and 3 (rather than bytes in Python 2 and
-text in Python 3, the default situation for unmarked string literals.)
-Otherwise running :djadmin:`makemigrations` under Python 3 will generate
-spurious new migrations to convert all these string attributes to text.
-
-The easiest way to achieve this is to follow the advice in Django's
-:doc:`Python 3 porting guide </topics/python3>` and make sure that all your
-modules begin with ``from __future__ import unicode_literals``, so that all
-unmarked string literals are always unicode, regardless of Python version. When
-you add this to an app with existing migrations generated on Python 2, your
-next run of :djadmin:`makemigrations` on Python 3 will likely generate many
-changes as it converts all the bytestring attributes to text strings; this is
-normal and should only happen once.
-
Supporting multiple Django versions
===================================
diff --git a/docs/topics/templates.txt b/docs/topics/templates.txt
index a819acf3f0..23d74cbaa3 100644
--- a/docs/topics/templates.txt
+++ b/docs/topics/templates.txt
@@ -422,8 +422,6 @@ environment.
For example, you can create ``myproject/jinja2.py`` with this content::
- from __future__ import absolute_import # Python 2 only
-
from django.contrib.staticfiles.storage import staticfiles_storage
from django.urls import reverse