mirror of https://github.com/django/django.git
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(
|
||||
'Cannot use ImageField because Pillow is not installed.',
|
||||
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,
|
||||
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:
|
||||
|
||||
pip install tblib
|
||||
python -m pip install tblib
|
||||
""".format(test, original_exc_txt))
|
||||
else:
|
||||
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:
|
||||
|
||||
* 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
|
||||
Windows) at a shell prompt.
|
||||
|
|
|
@ -12,7 +12,7 @@ dependencies and is easy to install and use.
|
|||
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`_.
|
||||
|
||||
.. _gunicorn documentation: https://docs.gunicorn.org/en/latest/install.html
|
||||
|
|
|
@ -27,10 +27,10 @@ command. For example:
|
|||
.. code-block:: console
|
||||
|
||||
# Install current stable version.
|
||||
$ pip install uwsgi
|
||||
$ python -m pip install uwsgi
|
||||
|
||||
# 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
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ You can install ReportLab with ``pip``:
|
|||
|
||||
.. console::
|
||||
|
||||
$ pip install reportlab
|
||||
$ python -m pip install reportlab
|
||||
|
||||
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::
|
||||
|
||||
$ pip install -U Django
|
||||
$ python -m pip install -U Django
|
||||
|
||||
.. _pip: https://pip.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
|
||||
project. Simply type::
|
||||
|
||||
pip install virtualenvwrapper-win
|
||||
python -m pip install virtualenvwrapper-win
|
||||
|
||||
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
|
||||
the following command::
|
||||
|
||||
pip install django
|
||||
python -m pip install django
|
||||
|
||||
This will download and install the latest Django release.
|
||||
|
||||
|
@ -93,8 +93,8 @@ Common pitfalls
|
|||
than one Python version installed.
|
||||
|
||||
* 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
|
||||
for proxy configuration in the command prompt as follows::
|
||||
in running the command ``python -m pip install django``. Set the environment
|
||||
variables for proxy configuration in the command prompt as follows::
|
||||
|
||||
set http_proxy=http://username:password@proxyserver:proxyport
|
||||
set https_proxy=https://username:password@proxyserver:proxyport
|
||||
|
|
|
@ -96,7 +96,7 @@ Imports
|
|||
|
||||
.. console::
|
||||
|
||||
$ pip install isort
|
||||
$ python -m pip install isort
|
||||
$ isort -rc .
|
||||
|
||||
This runs ``isort`` recursively from your current directory, modifying any
|
||||
|
|
|
@ -55,7 +55,7 @@ version. To run it:
|
|||
|
||||
.. console::
|
||||
|
||||
$ pip install closure
|
||||
$ python -m pip install closure
|
||||
$ python django/contrib/admin/bin/compress.py
|
||||
|
||||
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
|
||||
$ cd django-repo/tests
|
||||
$ pip install -e ..
|
||||
$ pip install -r requirements/py3.txt
|
||||
$ python -m pip install -e ..
|
||||
$ python -m pip install -r requirements/py3.txt
|
||||
$ ./runtests.py
|
||||
|
||||
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``
|
||||
command from any place in the Django source tree::
|
||||
|
||||
$ pip install tox
|
||||
$ python -m pip install tox
|
||||
$ tox
|
||||
|
||||
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
|
||||
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
|
||||
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::
|
||||
|
||||
$ pip install Sphinx
|
||||
$ python -m pip install Sphinx
|
||||
|
||||
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::
|
||||
|
||||
$ pip install wheel twine
|
||||
$ python -m pip install wheel twine
|
||||
|
||||
* 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
|
||||
$ deactivate
|
||||
$ 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
|
||||
$ 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
|
||||
|
||||
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::
|
||||
|
||||
$ 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
|
||||
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::
|
||||
|
||||
$ 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
|
||||
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
|
||||
<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
|
||||
server again to confirm this.
|
||||
|
||||
#. To uninstall the package, use pip::
|
||||
|
||||
pip uninstall django-polls
|
||||
python -m pip uninstall django-polls
|
||||
|
||||
Publishing your app
|
||||
===================
|
||||
|
|
|
@ -163,7 +163,7 @@ You can get a local copy of the HTML documentation following a few easy steps:
|
|||
|
||||
.. console::
|
||||
|
||||
$ pip install Sphinx
|
||||
$ python -m pip install Sphinx
|
||||
|
||||
* Then, just use the included ``Makefile`` to turn the documentation into
|
||||
HTML:
|
||||
|
|
|
@ -316,7 +316,7 @@ psycopg2
|
|||
After you've installed the KyngChaos binaries and modified your ``PATH``, as
|
||||
described above, ``psycopg2`` may be installed using the following command::
|
||||
|
||||
$ pip install psycopg2
|
||||
$ python -m pip install psycopg2
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
|
@ -1403,7 +1403,7 @@ correctly:
|
|||
|
||||
.. 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
|
||||
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
|
||||
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
|
||||
upgrade setuptools. This is resolved in later versions of Django as described
|
||||
in the :doc:`/releases/1.9.2`.
|
||||
using pip, you can upgrade pip using ``python -m pip install -U pip`` which
|
||||
will also upgrade setuptools. This is resolved in later versions of Django as
|
||||
described in the :doc:`/releases/1.9.2`.
|
||||
|
||||
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:
|
||||
|
||||
#. Install the `argon2-cffi library`_. This can be done by running ``pip
|
||||
install django[argon2]``, which is equivalent to ``pip install argon2-cffi``
|
||||
(along with any version requirement from Django's ``setup.py``).
|
||||
#. Install the `argon2-cffi library`_. This can be done by running
|
||||
``python -m pip install django[argon2]``, which is equivalent to
|
||||
``python -m pip install argon2-cffi`` (along with any version requirement
|
||||
from Django's ``setup.py``).
|
||||
|
||||
#. Modify :setting:`PASSWORD_HASHERS` to list ``Argon2PasswordHasher`` first.
|
||||
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:
|
||||
|
||||
#. Install the `bcrypt library`_. This can be done by running ``pip install
|
||||
django[bcrypt]``, which is equivalent to ``pip install bcrypt`` (along with
|
||||
any version requirement from Django's ``setup.py``).
|
||||
#. Install the `bcrypt library`_. This can be done by running
|
||||
``python -m pip install django[bcrypt]``, which is equivalent to
|
||||
``python -m pip install bcrypt`` (along with any version requirement from
|
||||
Django's ``setup.py``).
|
||||
|
||||
#. Modify :setting:`PASSWORD_HASHERS` to list ``BCryptSHA256PasswordHasher``
|
||||
first. That is, in your settings file, you'd put::
|
||||
|
|
|
@ -155,7 +155,7 @@ This is the recommended way to install Django.
|
|||
|
||||
.. console::
|
||||
|
||||
$ pip install Django
|
||||
$ python -m pip install Django
|
||||
|
||||
.. _pip: https://pip.pypa.io/
|
||||
.. _virtualenv: https://virtualenv.pypa.io/
|
||||
|
@ -214,7 +214,7 @@ latest bug fixes and improvements, follow these instructions:
|
|||
|
||||
.. console::
|
||||
|
||||
$ pip install -e django/
|
||||
$ python -m pip install -e django/
|
||||
|
||||
This will make Django's code importable, and will also make the
|
||||
``django-admin`` utility command available. In other words, you're all
|
||||
|
|
|
@ -385,7 +385,7 @@ Requires Jinja2_ to be installed:
|
|||
|
||||
.. console::
|
||||
|
||||
$ pip install Jinja2
|
||||
$ python -m pip install Jinja2
|
||||
|
||||
Set :setting:`BACKEND <TEMPLATES-BACKEND>` to
|
||||
``'django.template.backends.jinja2.Jinja2'`` to configure a Jinja2_ engine.
|
||||
|
|
|
@ -920,7 +920,7 @@ Python path:
|
|||
|
||||
.. console::
|
||||
|
||||
$ pip install selenium
|
||||
$ python -m pip install selenium
|
||||
|
||||
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
|
||||
|
|
|
@ -2,8 +2,8 @@ To run the test suite, first, create and activate a virtual environment. Then
|
|||
install some requirements and run the tests::
|
||||
|
||||
$ cd tests
|
||||
$ pip install -e ..
|
||||
$ pip install -r requirements/py3.txt
|
||||
$ python -m pip install -e ..
|
||||
$ python -m pip install -r requirements/py3.txt
|
||||
$ ./runtests.py
|
||||
|
||||
For more information about the test suite, see
|
||||
|
|
|
@ -631,7 +631,7 @@ class ImageFieldTests(SimpleTestCase):
|
|||
Error(
|
||||
'Cannot use ImageField because Pillow is not installed.',
|
||||
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,
|
||||
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
|
||||
# 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"
|
||||
# from this directory.
|
||||
# supported Python versions. To use it, "python -m pip install tox" and
|
||||
# then run "tox" from this directory.
|
||||
|
||||
[tox]
|
||||
skipsdist = true
|
||||
|
|
Loading…
Reference in New Issue