Use code-block directive for snippets

Correct spacing between sentences.

Update URLs (http -> https)
This commit is contained in:
Peter Bittner 2017-01-29 21:55:27 +01:00
parent e8e2d84158
commit 7d96f8e618
7 changed files with 43 additions and 30 deletions

View file

@ -18,7 +18,9 @@ initialization code if the client IP address is detected as one from the
:data:`ANALYTICAL_INTERNAL_IPS` setting. The default value for this
setting is :data:`INTERNAL_IPS`.
Example::
Example:
.. code-block:: python
ANALYTICAL_INTERNAL_IPS = ['192.168.1.45', '192.168.1.57']
@ -45,7 +47,9 @@ logged in through the standard Django authentication system and the
current user is accessible in the template context, the username can be
passed to the analytics services that support identifying users. This
feature is configured by the :data:`ANALYTICAL_AUTO_IDENTIFY` setting
and is enabled by default. To disable::
and is enabled by default. To disable:
.. code-block:: python
ANALYTICAL_AUTO_IDENTIFY = False

View file

@ -10,7 +10,7 @@ version numbers. Patch-level increments indicate bug fixes, minor
version increments indicate new functionality and major version
increments indicate backwards incompatible changes.
Version 1.0.0 is the last to support Django < 1.7. Users of older django
Version 1.0.0 is the last to support Django < 1.7. Users of older Django
versions should stick to 1.0.0, and are encouraged to upgrade their setups.
Starting with 2.0.0, dropping support for obsolete Django versions is not
considered to be a backward-incompatible change.

View file

@ -5,10 +5,10 @@ django-analytical
The django-analytical application integrates analytics services into a
Django_ project.
.. _Django: http://www.djangoproject.com/
.. _Django: https://www.djangoproject.com/
:Package: http://pypi.python.org/pypi/django-analytical/
:Source: http://github.com/jcassee/django-analytical
:Package: https://pypi.python.org/pypi/django-analytical/
:Source: https://github.com/jcassee/django-analytical
Overview

View file

@ -74,26 +74,26 @@ HTML page, django-analytical provides four general-purpose template tags
that will render the code needed for the services you are using. Your
base template should look like this:
.. code-block:: html
.. code-block:: django
{% load analytical %}
<!DOCTYPE ... >
<html>
<head>
{% analytical_head_top %}
{% load analytical %}
<!DOCTYPE ... >
<html>
<head>
{% analytical_head_top %}
...
...
{% analytical_head_bottom %}
</head>
<body>
{% analytical_body_top %}
{% analytical_head_bottom %}
</head>
<body>
{% analytical_body_top %}
...
...
{% analytical_body_bottom %}
</body>
</html>
{% analytical_body_bottom %}
</body>
</html>
Instead of using the generic tags, you can also just use tags specific
for the analytics service(s) you are using. See :ref:`services` for

View file

@ -19,7 +19,7 @@ django-analytical, please create an issue on the project
Currently supported services:
.. toctree::
:maxdepth: 1
:glob:
:maxdepth: 1
:glob:
services/*
services/*

View file

@ -6,7 +6,6 @@ Here's a full list of all available settings, in alphabetical order, and
their default values.
.. data:: ANALYTICAL_AUTO_IDENTIFY
Default: ``True``

View file

@ -29,7 +29,9 @@ Setting up basic tracking
To get started with django-analytical, the package must first be
installed. You can download and install the latest stable package from
the Python Package Index automatically by using ``easy_install``::
the Python Package Index automatically by using ``easy_install``:
.. code-block:: bash
$ easy_install django-analytical
@ -37,7 +39,9 @@ For more ways to install django-analytical, see
:ref:`installing-the-package`.
After you install django-analytical, you need to add it to the list of
installed applications in the ``settings.py`` file of your project::
installed applications in the ``settings.py`` file of your project:
.. code-block:: python
INSTALLED_APPS = [
...
@ -46,7 +50,9 @@ installed applications in the ``settings.py`` file of your project::
]
Then you have to add the general-purpose django-analytical template tags
to your base template::
to your base template:
.. code-block:: django
{% load analytical %}
<!DOCTYPE ... >
@ -69,7 +75,9 @@ to your base template::
Finally, you need to configure the Clicky Site ID and the Crazy Egg
account number. Add the following to your project :file:`settings.py`
file (replacing the ``x``'s with your own codes)::
file (replacing the ``x``'s with your own codes):
.. code-block:: python
CLICKY_SITE_ID = 'xxxxxxxx'
CRAZY_EGG_ACCOUNT_NUMBER = 'xxxxxxxx'
@ -110,7 +118,9 @@ protocol version.
In order to filter on protocol version in Crazy Egg, you need to
include the visitor IP protocol version in the Crazy Egg tracking code.
The easiest way to do this is by using a context processor::
The easiest way to do this is by using a context processor:
.. code-block:: python
def track_ip_proto(request):
addr = request.META.get('HTTP_X_FORWARDED_FOR', '')