File: install.rst

package info (click to toggle)
python-django-treebeard 4.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 988 kB
  • sloc: python: 5,317; javascript: 258; makefile: 180; sh: 6
file content (87 lines) | stat: -rw-r--r-- 2,086 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Installation
============


Prerequisites
-------------

``django-treebeard`` needs at least **Python 3.6** to run, and **Django 2.2 or later**.


Installing
----------

You have several ways to install ``django-treebeard``. If you're not sure,
`just use pip <http://guide.python-distribute.org/pip.html>`_

pip (or easy_install)
~~~~~~~~~~~~~~~~~~~~~

You can install the release versions from
`django-treebeard's PyPI page`_ using ``pip``:

.. code-block:: console

  $ pip install django-treebeard

or if for some reason you can't use ``pip``, you can try ``easy_install``,
(at your own risk):

.. code-block:: console

  $ easy_install --always-unzip django-treebeard


setup.py
~~~~~~~~

Download a release from the `treebeard download page`_ and unpack it, then
run:

.. _`treebeard download page`: https://github.com/django-treebeard/django-treebeard/releases

.. code-block:: console

   $ python setup.py install


.deb packages
~~~~~~~~~~~~~

Both Debian and Ubuntu include ``django-treebeard`` as a package, so you can
just use:

.. code-block:: console

   $ apt-get install python-django-treebeard

or:

.. code-block:: console

   $ aptitude install python-django-treebeard

Remember that the packages included in linux distributions are usually not the
most recent versions.


Configuration
-------------

Add ``'treebeard'`` to the
:django:setting:`INSTALLED_APPS` section in your django
settings file.

.. note::

   If you are going to use the :class:`~treebeard.admin.TreeAdmin`
   class, you need to add the path to treebeard's templates in
   :django:setting:`TEMPLATE_DIRS`.
   Also you need to add
   ``django.template.context_processors.request``
   to :django:setting:`TEMPLATES['OPTIONS']['context_processors']`
   setting in your django settings file (see https://docs.djangoproject.com/en/1.11/ref/templates/upgrading/ for how to define this setting within the TEMPLATES settings). For more recent versions of Django, use ``django.core.context_processors.request`` instead.


.. _`django-treebeard's PyPI page`:
   https://pypi.org/project/django-treebeard/