mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
[1.8.x] Fixed #24358 -- Corrected code-block directives for console sessions.
Backport of eba6dff581 from master
This commit is contained in:
@@ -34,7 +34,7 @@ but may not be mandatory depending on your particular database backend,
|
||||
operating system and time zone. If you encounter an exception querying dates
|
||||
or times, please try installing it before filing a bug. It's as simple as:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
$ pip install pytz
|
||||
|
||||
|
||||
@@ -140,9 +140,9 @@ uninstalling is as simple as deleting the ``django`` directory from your Python
|
||||
``site-packages``. To find the directory you need to remove, you can run the
|
||||
following at your shell prompt (not the interactive Python prompt):
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
python -c "import sys; sys.path = sys.path[1:]; import django; print(django.__path__)"
|
||||
$ python -c "import sys; sys.path = sys.path[1:]; import django; print(django.__path__)"
|
||||
|
||||
|
||||
.. _install-django-code:
|
||||
@@ -256,18 +256,18 @@ latest bug fixes and improvements, follow these instructions:
|
||||
2. Check out Django's main development branch (the 'trunk' or 'master') like
|
||||
so:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
git clone git://github.com/django/django.git django-trunk
|
||||
$ git clone git://github.com/django/django.git django-trunk
|
||||
|
||||
This will create a directory ``django-trunk`` in your current directory.
|
||||
|
||||
3. Make sure that the Python interpreter can load Django's code. The most
|
||||
convenient way to do this is via pip_. Run the following command:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
sudo pip install -e django-trunk/
|
||||
$ sudo pip install -e django-trunk/
|
||||
|
||||
(If using a virtualenv_ you can omit ``sudo``.)
|
||||
|
||||
@@ -302,9 +302,9 @@ with a checkout of Django's latest code in it. Then add a ``.pth`` file
|
||||
containing the full path to the ``django-trunk`` directory to your system's
|
||||
``site-packages`` directory. For example, on a Unix-like system:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
echo WORKING-DIR/django-trunk > SITE-PACKAGES-DIR/django.pth
|
||||
$ echo WORKING-DIR/django-trunk > SITE-PACKAGES-DIR/django.pth
|
||||
|
||||
In the above line, change ``WORKING-DIR/django-trunk`` to match the full path
|
||||
to your new ``django-trunk`` directory, and change ``SITE-PACKAGES-DIR`` to
|
||||
@@ -314,9 +314,9 @@ The location of the ``site-packages`` directory depends on the operating
|
||||
system, and the location in which Python was installed. To find your system's
|
||||
``site-packages`` location, execute the following:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
|
||||
$ python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
|
||||
|
||||
(Note that this should be run from a shell prompt, not a Python interactive
|
||||
prompt.)
|
||||
@@ -334,9 +334,9 @@ On Unix-like systems, create a symbolic link to the file
|
||||
``django-trunk/django/bin/django-admin`` in a directory on your system
|
||||
path, such as ``/usr/local/bin``. For example:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
ln -s WORKING-DIR/django-trunk/django/bin/django-admin.py /usr/local/bin/
|
||||
$ ln -s WORKING-DIR/django-trunk/django/bin/django-admin.py /usr/local/bin/
|
||||
|
||||
(In the above line, change WORKING-DIR to match the full path to your new
|
||||
``django-trunk`` directory.)
|
||||
|
||||
@@ -766,9 +766,9 @@ to change the default address (in the case, for example, where the 8081 port is
|
||||
already taken) then you may pass a different one to the :djadmin:`test` command
|
||||
via the :djadminopt:`--liveserver` option, for example:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
./manage.py test --liveserver=localhost:8082
|
||||
$ ./manage.py test --liveserver=localhost:8082
|
||||
|
||||
Another way of changing the default server address is by setting the
|
||||
`DJANGO_LIVE_TEST_SERVER_ADDRESS` environment variable somewhere in your
|
||||
@@ -784,9 +784,9 @@ tests might randomly fail with an "Address already in use" error. To avoid this
|
||||
problem, you can pass a comma-separated list of ports or ranges of ports (at
|
||||
least as many as the number of potential parallel processes). For example:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
./manage.py test --liveserver=localhost:8082,8090-8100,9000-9200,7041
|
||||
$ ./manage.py test --liveserver=localhost:8082,8090-8100,9000-9200,7041
|
||||
|
||||
Then, during test execution, each new live test server will try every specified
|
||||
port until it finds one that is free and takes it.
|
||||
@@ -797,9 +797,9 @@ To demonstrate how to use ``LiveServerTestCase``, let's write a simple Selenium
|
||||
test. First of all, you need to install the `selenium package`_ into your
|
||||
Python path:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
pip install selenium
|
||||
$ pip install selenium
|
||||
|
||||
Then, add a ``LiveServerTestCase``-based test to your app's tests module
|
||||
(for example: ``myapp/tests.py``). The code for this test may look as follows::
|
||||
@@ -830,9 +830,9 @@ Then, add a ``LiveServerTestCase``-based test to your app's tests module
|
||||
|
||||
Finally, you may run the test as follows:
|
||||
|
||||
.. code-block:: bash
|
||||
.. code-block:: console
|
||||
|
||||
./manage.py test myapp.tests.MySeleniumTests.test_login
|
||||
$ ./manage.py test myapp.tests.MySeleniumTests.test_login
|
||||
|
||||
This example will automatically open Firefox then go to the login page, enter
|
||||
the credentials and press the "Log in" button. Selenium offers other drivers in
|
||||
|
||||
Reference in New Issue
Block a user