.. highlight:: shell

============
Installation
============


Stable release
--------------

To install Django lookup extensions, run this command in your terminal:

.. code-block:: console

    $ pip install django-lookup-extensions

This is the preferred method to install Django lookup extensions, as it will always install the most recent stable release.

If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.

.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/


From sources
------------

The sources for Django lookup extensions can be downloaded from the `Github repo`_.

You can either clone the public repository:

.. code-block:: console

    $ git clone git://github.com/uncovertruth/django-lookup-extensions

Or download the `tarball`_:

.. code-block:: console

    $ curl  -OL https://github.com/uncovertruth/django-lookup-extensions/tarball/master

Once you have a copy of the source, you can install it with:

.. code-block:: console

    $ python setup.py install


.. _Github repo: https://github.com/uncovertruth/django-lookup-extensions
.. _tarball: https://github.com/uncovertruth/django-lookup-extensions/tarball/master

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

Add ``lookup_extensions`` to your ``INSTALLED_APPS`` setting::

    INSTALLED_APPS = [
        'lookup_extensions',
        # ...
    ]

Change ``DATABASE`` 's ``ENGINE`` setting::

    DATABASES = {
        'default': {
            'ENGINE': 'lookup_extensions.backends.postgresql',
            # ...
        },
    }

* For PostgreSQL/Redshift: ``lookup_extensions.backends.postgresql``
* For MySQL: ``lookup_extensions.backends.mysql``
* SQLite: ``lookup_extensions.backends.sqlite3``
