Fixed #30367 -- Changed "pip install" to "python -m pip install" in docs, comments and hints.
This commit is contained in:
parent
ceab25bc6d
commit
aed89adad5
|
@ -377,7 +377,7 @@ class ImageField(FileField):
|
||||||
checks.Error(
|
checks.Error(
|
||||||
'Cannot use ImageField because Pillow is not installed.',
|
'Cannot use ImageField because Pillow is not installed.',
|
||||||
hint=('Get Pillow at https://pypi.org/project/Pillow/ '
|
hint=('Get Pillow at https://pypi.org/project/Pillow/ '
|
||||||
'or run command "pip install Pillow".'),
|
'or run command "python -m pip install Pillow".'),
|
||||||
obj=self,
|
obj=self,
|
||||||
id='fields.E210',
|
id='fields.E210',
|
||||||
)
|
)
|
||||||
|
|
|
@ -145,7 +145,7 @@ parallel test runner to handle this exception cleanly.
|
||||||
|
|
||||||
In order to see the traceback, you should install tblib:
|
In order to see the traceback, you should install tblib:
|
||||||
|
|
||||||
pip install tblib
|
python -m pip install tblib
|
||||||
""".format(test, original_exc_txt))
|
""".format(test, original_exc_txt))
|
||||||
else:
|
else:
|
||||||
print("""
|
print("""
|
||||||
|
|
|
@ -6,7 +6,7 @@ This allows it to be built into other forms for easier viewing and browsing.
|
||||||
|
|
||||||
To create an HTML version of the docs:
|
To create an HTML version of the docs:
|
||||||
|
|
||||||
* Install Sphinx (using ``pip install Sphinx`` or some other method)
|
* Install Sphinx (using ``python -m pip install Sphinx`` or some other method).
|
||||||
|
|
||||||
* In this docs/ directory, type ``make html`` (or ``make.bat html`` on
|
* In this docs/ directory, type ``make html`` (or ``make.bat html`` on
|
||||||
Windows) at a shell prompt.
|
Windows) at a shell prompt.
|
||||||
|
|
|
@ -12,7 +12,7 @@ dependencies and is easy to install and use.
|
||||||
Installing Gunicorn
|
Installing Gunicorn
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Installing gunicorn is as easy as ``pip install gunicorn``. For more
|
Installing gunicorn is as easy as ``python -m pip install gunicorn``. For more
|
||||||
details, see the `gunicorn documentation`_.
|
details, see the `gunicorn documentation`_.
|
||||||
|
|
||||||
.. _gunicorn documentation: https://docs.gunicorn.org/en/latest/install.html
|
.. _gunicorn documentation: https://docs.gunicorn.org/en/latest/install.html
|
||||||
|
|
|
@ -27,10 +27,10 @@ command. For example:
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
# Install current stable version.
|
# Install current stable version.
|
||||||
$ pip install uwsgi
|
$ python -m pip install uwsgi
|
||||||
|
|
||||||
# Or install LTS (long term support).
|
# Or install LTS (long term support).
|
||||||
$ pip install https://projects.unbit.it/downloads/uwsgi-lts.tar.gz
|
$ python -m pip install https://projects.unbit.it/downloads/uwsgi-lts.tar.gz
|
||||||
|
|
||||||
.. _installation procedures: https://uwsgi-docs.readthedocs.io/en/latest/Install.html
|
.. _installation procedures: https://uwsgi-docs.readthedocs.io/en/latest/Install.html
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ You can install ReportLab with ``pip``:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install reportlab
|
$ python -m pip install reportlab
|
||||||
|
|
||||||
Test your installation by importing it in the Python interactive interpreter::
|
Test your installation by importing it in the Python interactive interpreter::
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ If you installed Django with pip_, you can use the ``--upgrade`` or ``-U`` flag:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install -U Django
|
$ python -m pip install -U Django
|
||||||
|
|
||||||
.. _pip: https://pip.pypa.io/
|
.. _pip: https://pip.pypa.io/
|
||||||
.. _virtualenv: https://virtualenv.pypa.io/
|
.. _virtualenv: https://virtualenv.pypa.io/
|
||||||
|
|
|
@ -50,7 +50,7 @@ each Django project you create. While not mandatory, this is considered a best
|
||||||
practice and will save you time in the future when you're ready to deploy your
|
practice and will save you time in the future when you're ready to deploy your
|
||||||
project. Simply type::
|
project. Simply type::
|
||||||
|
|
||||||
pip install virtualenvwrapper-win
|
python -m pip install virtualenvwrapper-win
|
||||||
|
|
||||||
Then create a virtual environment for your project::
|
Then create a virtual environment for your project::
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ Django can be installed easily using ``pip`` within your virtual environment.
|
||||||
In the command prompt, ensure your virtual environment is active, and execute
|
In the command prompt, ensure your virtual environment is active, and execute
|
||||||
the following command::
|
the following command::
|
||||||
|
|
||||||
pip install django
|
python -m pip install django
|
||||||
|
|
||||||
This will download and install the latest Django release.
|
This will download and install the latest Django release.
|
||||||
|
|
||||||
|
@ -93,8 +93,8 @@ Common pitfalls
|
||||||
than one Python version installed.
|
than one Python version installed.
|
||||||
|
|
||||||
* If you are connecting to the internet behind a proxy, there might be problem
|
* If you are connecting to the internet behind a proxy, there might be problem
|
||||||
in running the command ``pip install django``. Set the environment variables
|
in running the command ``python -m pip install django``. Set the environment
|
||||||
for proxy configuration in the command prompt as follows::
|
variables for proxy configuration in the command prompt as follows::
|
||||||
|
|
||||||
set http_proxy=http://username:password@proxyserver:proxyport
|
set http_proxy=http://username:password@proxyserver:proxyport
|
||||||
set https_proxy=https://username:password@proxyserver:proxyport
|
set https_proxy=https://username:password@proxyserver:proxyport
|
||||||
|
|
|
@ -96,7 +96,7 @@ Imports
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install isort
|
$ python -m pip install isort
|
||||||
$ isort -rc .
|
$ isort -rc .
|
||||||
|
|
||||||
This runs ``isort`` recursively from your current directory, modifying any
|
This runs ``isort`` recursively from your current directory, modifying any
|
||||||
|
|
|
@ -55,7 +55,7 @@ version. To run it:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install closure
|
$ python -m pip install closure
|
||||||
$ python django/contrib/admin/bin/compress.py
|
$ python django/contrib/admin/bin/compress.py
|
||||||
|
|
||||||
Behind the scenes, ``compress.py`` is a front-end for Google's
|
Behind the scenes, ``compress.py`` is a front-end for Google's
|
||||||
|
|
|
@ -30,8 +30,8 @@ Next, clone your fork, install some requirements, and run the tests::
|
||||||
|
|
||||||
$ git clone git@github.com:YourGitHubName/django.git django-repo
|
$ git clone git@github.com:YourGitHubName/django.git django-repo
|
||||||
$ cd django-repo/tests
|
$ cd django-repo/tests
|
||||||
$ pip install -e ..
|
$ python -m pip install -e ..
|
||||||
$ pip install -r requirements/py3.txt
|
$ python -m pip install -r requirements/py3.txt
|
||||||
$ ./runtests.py
|
$ ./runtests.py
|
||||||
|
|
||||||
Installing the requirements will likely require some operating system packages
|
Installing the requirements will likely require some operating system packages
|
||||||
|
@ -68,7 +68,7 @@ and other checks (such as :ref:`import sorting <coding-style-imports>`, the
|
||||||
:ref:`code formatting <coding-style-python>`), install and run the ``tox``
|
:ref:`code formatting <coding-style-python>`), install and run the ``tox``
|
||||||
command from any place in the Django source tree::
|
command from any place in the Django source tree::
|
||||||
|
|
||||||
$ pip install tox
|
$ python -m pip install tox
|
||||||
$ tox
|
$ tox
|
||||||
|
|
||||||
By default, ``tox`` runs the test suite with the bundled test settings file for
|
By default, ``tox`` runs the test suite with the bundled test settings file for
|
||||||
|
@ -240,7 +240,7 @@ You can find these dependencies in `pip requirements files`_ inside the
|
||||||
``tests/requirements`` directory of the Django source tree and install them
|
``tests/requirements`` directory of the Django source tree and install them
|
||||||
like so::
|
like so::
|
||||||
|
|
||||||
$ pip install -r tests/requirements/py3.txt
|
$ python -m pip install -r tests/requirements/py3.txt
|
||||||
|
|
||||||
If you encounter an error during the installation, your system might be missing
|
If you encounter an error during the installation, your system might be missing
|
||||||
a dependency for one or more of the Python packages. Consult the failing
|
a dependency for one or more of the Python packages. Consult the failing
|
||||||
|
|
|
@ -49,7 +49,7 @@ To build the documentation locally, install Sphinx:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install Sphinx
|
$ python -m pip install Sphinx
|
||||||
|
|
||||||
Then from the ``docs`` directory, build the HTML:
|
Then from the ``docs`` directory, build the HTML:
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ You'll need a few things before getting started:
|
||||||
|
|
||||||
* An install of some required Python packages::
|
* An install of some required Python packages::
|
||||||
|
|
||||||
$ pip install wheel twine
|
$ python -m pip install wheel twine
|
||||||
|
|
||||||
* Access to Django's record on PyPI. Create a file with your credentials:
|
* Access to Django's record on PyPI. Create a file with your credentials:
|
||||||
|
|
||||||
|
@ -305,10 +305,10 @@ Now you're ready to actually put the release out there. To do this:
|
||||||
$ easy_install https://www.djangoproject.com/m/releases/$MAJOR_VERSION/Django-$RELEASE_VERSION.tar.gz
|
$ easy_install https://www.djangoproject.com/m/releases/$MAJOR_VERSION/Django-$RELEASE_VERSION.tar.gz
|
||||||
$ deactivate
|
$ deactivate
|
||||||
$ mktmpenv
|
$ mktmpenv
|
||||||
$ pip install https://www.djangoproject.com/m/releases/$MAJOR_VERSION/Django-$RELEASE_VERSION.tar.gz
|
$ python -m pip install https://www.djangoproject.com/m/releases/$MAJOR_VERSION/Django-$RELEASE_VERSION.tar.gz
|
||||||
$ deactivate
|
$ deactivate
|
||||||
$ mktmpenv
|
$ mktmpenv
|
||||||
$ pip install https://www.djangoproject.com/m/releases/$MAJOR_VERSION/Django-$RELEASE_VERSION-py3-none-any.whl
|
$ python -m pip install https://www.djangoproject.com/m/releases/$MAJOR_VERSION/Django-$RELEASE_VERSION-py3-none-any.whl
|
||||||
$ deactivate
|
$ deactivate
|
||||||
|
|
||||||
This just tests that the tarballs are available (i.e. redirects are up) and
|
This just tests that the tarballs are available (i.e. redirects are up) and
|
||||||
|
|
|
@ -173,7 +173,7 @@ Go ahead and install the previously cloned copy of Django:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install -e /path/to/your/local/clone/django/
|
$ python -m pip install -e /path/to/your/local/clone/django/
|
||||||
|
|
||||||
The installed version of Django is now pointing at your local copy. You will
|
The installed version of Django is now pointing at your local copy. You will
|
||||||
immediately see any changes you make to it, which is of great help when writing
|
immediately see any changes you make to it, which is of great help when writing
|
||||||
|
@ -195,7 +195,7 @@ Django ``tests/`` directory and then running:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install -r requirements/py3.txt
|
$ python -m pip install -r requirements/py3.txt
|
||||||
|
|
||||||
If you encounter an error during the installation, your system might be missing
|
If you encounter an error during the installation, your system might be missing
|
||||||
a dependency for one or more of the Python packages. Consult the failing
|
a dependency for one or more of the Python packages. Consult the failing
|
||||||
|
|
|
@ -280,14 +280,14 @@ working. We'll now fix this by installing our new ``django-polls`` package.
|
||||||
#. To install the package, use pip (you already :ref:`installed it
|
#. To install the package, use pip (you already :ref:`installed it
|
||||||
<installing-reusable-apps-prerequisites>`, right?)::
|
<installing-reusable-apps-prerequisites>`, right?)::
|
||||||
|
|
||||||
pip install --user django-polls/dist/django-polls-0.1.tar.gz
|
python -m pip install --user django-polls/dist/django-polls-0.1.tar.gz
|
||||||
|
|
||||||
#. With luck, your Django project should now work correctly again. Run the
|
#. With luck, your Django project should now work correctly again. Run the
|
||||||
server again to confirm this.
|
server again to confirm this.
|
||||||
|
|
||||||
#. To uninstall the package, use pip::
|
#. To uninstall the package, use pip::
|
||||||
|
|
||||||
pip uninstall django-polls
|
python -m pip uninstall django-polls
|
||||||
|
|
||||||
Publishing your app
|
Publishing your app
|
||||||
===================
|
===================
|
||||||
|
|
|
@ -163,7 +163,7 @@ You can get a local copy of the HTML documentation following a few easy steps:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install Sphinx
|
$ python -m pip install Sphinx
|
||||||
|
|
||||||
* Then, just use the included ``Makefile`` to turn the documentation into
|
* Then, just use the included ``Makefile`` to turn the documentation into
|
||||||
HTML:
|
HTML:
|
||||||
|
|
|
@ -316,7 +316,7 @@ psycopg2
|
||||||
After you've installed the KyngChaos binaries and modified your ``PATH``, as
|
After you've installed the KyngChaos binaries and modified your ``PATH``, as
|
||||||
described above, ``psycopg2`` may be installed using the following command::
|
described above, ``psycopg2`` may be installed using the following command::
|
||||||
|
|
||||||
$ pip install psycopg2
|
$ python -m pip install psycopg2
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
|
|
@ -1403,7 +1403,7 @@ correctly:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ pip install tblib
|
$ python -m pip install tblib
|
||||||
|
|
||||||
This feature isn't available on Windows. It doesn't work with the Oracle
|
This feature isn't available on Windows. It doesn't work with the Oracle
|
||||||
database backend either.
|
database backend either.
|
||||||
|
|
|
@ -1045,9 +1045,9 @@ When installing Django 1.9 or 1.9.1 with setuptools 5.5.x, you'll see::
|
||||||
|
|
||||||
It's safe to ignore these errors (Django will still install just fine), but you
|
It's safe to ignore these errors (Django will still install just fine), but you
|
||||||
can avoid them by upgrading setuptools to a more recent version. If you're
|
can avoid them by upgrading setuptools to a more recent version. If you're
|
||||||
using pip, you can upgrade pip using ``pip install -U pip`` which will also
|
using pip, you can upgrade pip using ``python -m pip install -U pip`` which
|
||||||
upgrade setuptools. This is resolved in later versions of Django as described
|
will also upgrade setuptools. This is resolved in later versions of Django as
|
||||||
in the :doc:`/releases/1.9.2`.
|
described in the :doc:`/releases/1.9.2`.
|
||||||
|
|
||||||
Miscellaneous
|
Miscellaneous
|
||||||
-------------
|
-------------
|
||||||
|
|
|
@ -86,9 +86,10 @@ use of Argon2 rather than the other algorithms supported by Django.
|
||||||
|
|
||||||
To use Argon2 as your default storage algorithm, do the following:
|
To use Argon2 as your default storage algorithm, do the following:
|
||||||
|
|
||||||
#. Install the `argon2-cffi library`_. This can be done by running ``pip
|
#. Install the `argon2-cffi library`_. This can be done by running
|
||||||
install django[argon2]``, which is equivalent to ``pip install argon2-cffi``
|
``python -m pip install django[argon2]``, which is equivalent to
|
||||||
(along with any version requirement from Django's ``setup.py``).
|
``python -m pip install argon2-cffi`` (along with any version requirement
|
||||||
|
from Django's ``setup.py``).
|
||||||
|
|
||||||
#. Modify :setting:`PASSWORD_HASHERS` to list ``Argon2PasswordHasher`` first.
|
#. Modify :setting:`PASSWORD_HASHERS` to list ``Argon2PasswordHasher`` first.
|
||||||
That is, in your settings file, you'd put::
|
That is, in your settings file, you'd put::
|
||||||
|
@ -115,9 +116,10 @@ use it Django supports bcrypt with minimal effort.
|
||||||
|
|
||||||
To use Bcrypt as your default storage algorithm, do the following:
|
To use Bcrypt as your default storage algorithm, do the following:
|
||||||
|
|
||||||
#. Install the `bcrypt library`_. This can be done by running ``pip install
|
#. Install the `bcrypt library`_. This can be done by running
|
||||||
django[bcrypt]``, which is equivalent to ``pip install bcrypt`` (along with
|
``python -m pip install django[bcrypt]``, which is equivalent to
|
||||||
any version requirement from Django's ``setup.py``).
|
``python -m pip install bcrypt`` (along with any version requirement from
|
||||||
|
Django's ``setup.py``).
|
||||||
|
|
||||||
#. Modify :setting:`PASSWORD_HASHERS` to list ``BCryptSHA256PasswordHasher``
|
#. Modify :setting:`PASSWORD_HASHERS` to list ``BCryptSHA256PasswordHasher``
|
||||||
first. That is, in your settings file, you'd put::
|
first. That is, in your settings file, you'd put::
|
||||||
|
|
|
@ -155,7 +155,7 @@ This is the recommended way to install Django.
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install Django
|
$ python -m pip install Django
|
||||||
|
|
||||||
.. _pip: https://pip.pypa.io/
|
.. _pip: https://pip.pypa.io/
|
||||||
.. _virtualenv: https://virtualenv.pypa.io/
|
.. _virtualenv: https://virtualenv.pypa.io/
|
||||||
|
@ -214,7 +214,7 @@ latest bug fixes and improvements, follow these instructions:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install -e django/
|
$ python -m pip install -e django/
|
||||||
|
|
||||||
This will make Django's code importable, and will also make the
|
This will make Django's code importable, and will also make the
|
||||||
``django-admin`` utility command available. In other words, you're all
|
``django-admin`` utility command available. In other words, you're all
|
||||||
|
|
|
@ -385,7 +385,7 @@ Requires Jinja2_ to be installed:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install Jinja2
|
$ python -m pip install Jinja2
|
||||||
|
|
||||||
Set :setting:`BACKEND <TEMPLATES-BACKEND>` to
|
Set :setting:`BACKEND <TEMPLATES-BACKEND>` to
|
||||||
``'django.template.backends.jinja2.Jinja2'`` to configure a Jinja2_ engine.
|
``'django.template.backends.jinja2.Jinja2'`` to configure a Jinja2_ engine.
|
||||||
|
|
|
@ -920,7 +920,7 @@ Python path:
|
||||||
|
|
||||||
.. console::
|
.. console::
|
||||||
|
|
||||||
$ pip install selenium
|
$ python -m pip install selenium
|
||||||
|
|
||||||
Then, add a ``LiveServerTestCase``-based test to your app's tests module
|
Then, add a ``LiveServerTestCase``-based test to your app's tests module
|
||||||
(for example: ``myapp/tests.py``). For this example, we'll assume you're using
|
(for example: ``myapp/tests.py``). For this example, we'll assume you're using
|
||||||
|
|
|
@ -2,8 +2,8 @@ To run the test suite, first, create and activate a virtual environment. Then
|
||||||
install some requirements and run the tests::
|
install some requirements and run the tests::
|
||||||
|
|
||||||
$ cd tests
|
$ cd tests
|
||||||
$ pip install -e ..
|
$ python -m pip install -e ..
|
||||||
$ pip install -r requirements/py3.txt
|
$ python -m pip install -r requirements/py3.txt
|
||||||
$ ./runtests.py
|
$ ./runtests.py
|
||||||
|
|
||||||
For more information about the test suite, see
|
For more information about the test suite, see
|
||||||
|
|
|
@ -631,7 +631,7 @@ class ImageFieldTests(SimpleTestCase):
|
||||||
Error(
|
Error(
|
||||||
'Cannot use ImageField because Pillow is not installed.',
|
'Cannot use ImageField because Pillow is not installed.',
|
||||||
hint=('Get Pillow at https://pypi.org/project/Pillow/ '
|
hint=('Get Pillow at https://pypi.org/project/Pillow/ '
|
||||||
'or run command "pip install Pillow".'),
|
'or run command "python -m pip install Pillow".'),
|
||||||
obj=field,
|
obj=field,
|
||||||
id='fields.E210',
|
id='fields.E210',
|
||||||
),
|
),
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -1,7 +1,7 @@
|
||||||
# Tox (https://tox.readthedocs.io/) is a tool for running tests in multiple
|
# Tox (https://tox.readthedocs.io/) is a tool for running tests in multiple
|
||||||
# virtualenvs. This configuration file helps to run the test suite on all
|
# virtualenvs. This configuration file helps to run the test suite on all
|
||||||
# supported Python versions. To use it, "pip install tox" and then run "tox"
|
# supported Python versions. To use it, "python -m pip install tox" and
|
||||||
# from this directory.
|
# then run "tox" from this directory.
|
||||||
|
|
||||||
[tox]
|
[tox]
|
||||||
skipsdist = true
|
skipsdist = true
|
||||||
|
|
Loading…
Reference in New Issue