mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[3.1.x] Used :envvar: role and .. envvar:: directive in various docs.
Backport of fbdb032de2 from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							345fa40cb5
						
					
				
				
					commit
					4eb5e4ee4f
				
			| @@ -111,7 +111,7 @@ Asynchronous support | ||||
|  | ||||
| The following checks verify your setup for :doc:`/topics/async`: | ||||
|  | ||||
| * **async.E001**: You should not set the ``DJANGO_ALLOW_ASYNC_UNSAFE`` | ||||
| * **async.E001**: You should not set the :envvar:`DJANGO_ALLOW_ASYNC_UNSAFE` | ||||
|   environment variable in deployment. This disables :ref:`async safety | ||||
|   protection <async-safety>`. | ||||
|  | ||||
|   | ||||
| @@ -32,7 +32,7 @@ features include: | ||||
|   in Python using ``ctypes``. | ||||
| * Loosely-coupled to GeoDjango.  For example, :class:`GEOSGeometry` objects | ||||
|   may be used outside of a Django project/application.  In other words, | ||||
|   no need to have ``DJANGO_SETTINGS_MODULE`` set or use a database, etc. | ||||
|   no need to have :envvar:`DJANGO_SETTINGS_MODULE` set or use a database, etc. | ||||
| * Mutability: :class:`GEOSGeometry` objects may be modified. | ||||
| * Cross-platform and tested; compatible with Windows, Linux, Solaris, and | ||||
|   macOS platforms. | ||||
|   | ||||
| @@ -127,8 +127,8 @@ Activates some additional checks that are only relevant in a deployment setting. | ||||
| You can use this option in your local development environment, but since your | ||||
| local development settings module may not have many of your production settings, | ||||
| you will probably want to point the ``check`` command at a different settings | ||||
| module, either by setting the ``DJANGO_SETTINGS_MODULE`` environment variable, | ||||
| or by passing the ``--settings`` option:: | ||||
| module, either by setting the :envvar:`DJANGO_SETTINGS_MODULE` environment | ||||
| variable, or by passing the ``--settings`` option:: | ||||
|  | ||||
|     django-admin check --deploy --settings=production_settings | ||||
|  | ||||
| @@ -942,8 +942,10 @@ more robust change detection, and a reduction in power usage. Django supports | ||||
|  | ||||
| .. admonition:: Watchman timeout | ||||
|  | ||||
|     .. envvar:: DJANGO_WATCHMAN_TIMEOUT | ||||
|  | ||||
|     The default timeout of ``Watchman`` client is 5 seconds. You can change it | ||||
|     by setting the ``DJANGO_WATCHMAN_TIMEOUT`` environment variable. | ||||
|     by setting the :envvar:`DJANGO_WATCHMAN_TIMEOUT` environment variable. | ||||
|  | ||||
| .. _Watchman: https://facebook.github.io/watchman/ | ||||
| .. _pywatchman: https://pypi.org/project/pywatchman/ | ||||
| @@ -1431,13 +1433,15 @@ Enables :ref:`SQL logging <django-db-logger>` for failing tests. If | ||||
|  | ||||
| .. django-admin-option:: --parallel [N] | ||||
|  | ||||
| .. envvar:: DJANGO_TEST_PROCESSES | ||||
|  | ||||
| Runs tests in separate parallel processes. Since modern processors have | ||||
| multiple cores, this allows running tests significantly faster. | ||||
|  | ||||
| By default ``--parallel`` runs one process per core according to | ||||
| :func:`multiprocessing.cpu_count()`. You can adjust the number of processes | ||||
| either by providing it as the option's value, e.g. ``--parallel=4``, or by | ||||
| setting the ``DJANGO_TEST_PROCESSES`` environment variable. | ||||
| setting the :envvar:`DJANGO_TEST_PROCESSES` environment variable. | ||||
|  | ||||
| Django distributes test cases — :class:`unittest.TestCase` subclasses — to | ||||
| subprocesses. If there are fewer test cases than configured processes, Django | ||||
| @@ -1614,6 +1618,8 @@ Example usage:: | ||||
|  | ||||
| .. django-admin:: createsuperuser | ||||
|  | ||||
| .. envvar:: DJANGO_SUPERUSER_PASSWORD | ||||
|  | ||||
| This command is only available if Django's :doc:`authentication system | ||||
| </topics/auth/index>` (``django.contrib.auth``) is installed. | ||||
|  | ||||
| @@ -1623,9 +1629,9 @@ programmatically generate superuser accounts for your site(s). | ||||
|  | ||||
| When run interactively, this command will prompt for a password for | ||||
| the new superuser account. When run non-interactively, you can provide | ||||
| a password by setting the ``DJANGO_SUPERUSER_PASSWORD`` environment variable. | ||||
| Otherwise, no password will be set, and the superuser account will not be able | ||||
| to log in until a password has been manually set for it. | ||||
| a password by setting the :envvar:`DJANGO_SUPERUSER_PASSWORD` environment | ||||
| variable. Otherwise, no password will be set, and the superuser account will | ||||
| not be able to log in until a password has been manually set for it. | ||||
|  | ||||
| In non-interactive mode, the | ||||
| :attr:`~django.contrib.auth.models.CustomUser.USERNAME_FIELD` and required | ||||
| @@ -1758,7 +1764,7 @@ allows for the following options: | ||||
| .. django-admin-option:: --pythonpath PYTHONPATH | ||||
|  | ||||
| Adds the given filesystem path to the Python `import search path`_. If this | ||||
| isn't provided, ``django-admin`` will use the ``PYTHONPATH`` environment | ||||
| isn't provided, ``django-admin`` will use the :envvar:`PYTHONPATH` environment | ||||
| variable. | ||||
|  | ||||
| This option is unnecessary in ``manage.py``, because it takes care of setting | ||||
| @@ -1774,7 +1780,8 @@ Example usage:: | ||||
|  | ||||
| Specifies the settings module to use. The settings module should be in Python | ||||
| package syntax, e.g. ``mysite.settings``. If this isn't provided, | ||||
| ``django-admin`` will use the ``DJANGO_SETTINGS_MODULE`` environment variable. | ||||
| ``django-admin`` will use the :envvar:`DJANGO_SETTINGS_MODULE` environment | ||||
| variable. | ||||
|  | ||||
| This option is unnecessary in ``manage.py``, because it uses | ||||
| ``settings.py`` from the current project by default. | ||||
| @@ -1844,6 +1851,8 @@ Extra niceties | ||||
| Syntax coloring | ||||
| --------------- | ||||
|  | ||||
| .. envvar:: DJANGO_COLORS | ||||
|  | ||||
| The ``django-admin`` / ``manage.py`` commands will use pretty | ||||
| color-coded output if your terminal supports ANSI-colored output. It | ||||
| won't use the color codes if you're piping the command's output to | ||||
| @@ -1865,7 +1874,7 @@ ships with three color palettes: | ||||
|  | ||||
| * ``nocolor``, which disables syntax highlighting. | ||||
|  | ||||
| You select a palette by setting a ``DJANGO_COLORS`` environment | ||||
| You select a palette by setting a :envvar:`DJANGO_COLORS` environment | ||||
| variable to specify the palette you want to use. For example, to | ||||
| specify the ``light`` palette under a Unix or OS/X BASH shell, you | ||||
| would run the following at a command prompt:: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user