summaryrefslogtreecommitdiff
path: root/docs/faq
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.es>2023-02-09 16:48:46 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-02-10 19:19:13 +0100
commit534ac4829764f317cf2fbc4a18354fcc998c1425 (patch)
treec85c1df220ea6c3a87f9820106ba5a06e9ec9394 /docs/faq
parent7bb741d787ba360a9f0d490db92e22e0d28204ed (diff)
Refs #34140 -- Applied rst code-block to non-Python examples.
Thanks to J.V. Zammit, Paolo Melchiorre, and Mariusz Felisiak for reviews.
Diffstat (limited to 'docs/faq')
-rw-r--r--docs/faq/general.txt4
-rw-r--r--docs/faq/models.txt18
-rw-r--r--docs/faq/troubleshooting.txt4
3 files changed, 18 insertions, 8 deletions
diff --git a/docs/faq/general.txt b/docs/faq/general.txt
index 1be9dc0cf4..41be777b3b 100644
--- a/docs/faq/general.txt
+++ b/docs/faq/general.txt
@@ -195,7 +195,9 @@ It's difficult to give an official citation format, for two reasons: citation
formats can vary wildly between publications, and citation standards for
software are still a matter of some debate.
-For example, `APA style`_, would dictate something like::
+For example, `APA style`_, would dictate something like:
+
+.. code-block:: text
Django (Version 1.5) [Computer Software]. (2013). Retrieved from https://www.djangoproject.com/.
diff --git a/docs/faq/models.txt b/docs/faq/models.txt
index 42c9604d53..3cb1c6166b 100644
--- a/docs/faq/models.txt
+++ b/docs/faq/models.txt
@@ -8,7 +8,9 @@ How can I see the raw SQL queries Django is running?
====================================================
Make sure your Django :setting:`DEBUG` setting is set to ``True``.
-Then do this::
+Then do this:
+
+.. code-block:: pycon
>>> from django.db import connection
>>> connection.queries
@@ -17,16 +19,18 @@ Then do this::
``connection.queries`` is only available if :setting:`DEBUG` is ``True``.
It's a list of dictionaries in order of query execution. Each dictionary has
-the following::
+the following:
- ``sql`` -- The raw SQL statement
- ``time`` -- How long the statement took to execute, in seconds.
+* ``sql`` - The raw SQL statement
+* ``time`` - How long the statement took to execute, in seconds.
``connection.queries`` includes all SQL statements -- INSERTs, UPDATES,
SELECTs, etc. Each time your app hits the database, the query will be recorded.
If you are using :doc:`multiple databases</topics/db/multi-db>`, you can use the
-same interface on each member of the ``connections`` dictionary::
+same interface on each member of the ``connections`` dictionary:
+
+.. code-block:: pycon
>>> from django.db import connections
>>> connections['my_db_alias'].queries
@@ -85,6 +89,8 @@ these options, create a migration with a
``ALTER TABLE`` statements that do what you want to do.
For example, if you're using MySQL and want your tables to use the MyISAM table
-type, use the following SQL::
+type, use the following SQL:
+
+.. code-block:: sql
ALTER TABLE myapp_mytable ENGINE=MyISAM;
diff --git a/docs/faq/troubleshooting.txt b/docs/faq/troubleshooting.txt
index ce468a56a6..21b1a70ba5 100644
--- a/docs/faq/troubleshooting.txt
+++ b/docs/faq/troubleshooting.txt
@@ -36,7 +36,9 @@ I'm getting a ``UnicodeDecodeError``. What am I doing wrong?
This class of errors happen when a bytestring containing non-ASCII sequences is
transformed into a Unicode string and the specified encoding is incorrect. The
-output generally looks like this::
+output generally looks like this:
+
+.. code-block:: pytb
UnicodeDecodeError: 'ascii' codec can't decode byte 0x?? in position ?:
ordinal not in range(128)