<commit_before>.. _installation:

Installation.
=============

Before install django-userena, you'll need to have a copy of `Django
<http://www.djangoproject.com>`_ 1.2 or newer installed.

For further information, consult the `Django download page
<http://www.djangoproject.com/download/>`_, which offers convenient packaged
downloads and installation instructions.

Installing django-userena.
--------------------------

You can install django-userena automagicly with ``easy_install`` or ``pip``. Or
manually placing it on on your ``PYTHON_PATH``.

I'm using `virtualenv <http://pypi.python.org/pypi/virtualenv>`_ to have an
isolated python environment. This way it's possible to create a tailored
environment for each project.

Automatic installation with easy_install.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Automatic install with `easy_install
<http://peak.telecommunity.com/DevCenter/EasyInstall>`_. All you have to do is
run the following command::

    easy_install django-userena

Manual installation with easy_install.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Clone the Git repository from Github. Then you can direct easy_install to the
``setup.py`` file. For ex.::

    git clone git://github.com/bread-and-pepper/django-userena.git
    cd django-userena
    easy_install setup.py


Automatic installation of development version with pip.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can tell `pip <http://pip.openplans.org/>`_ to install django-userena by
supplying it with the git repository on Github. Do this by typing the following
in your terminal::

    pip install -e git+git://github.com/bread-and-pepper/django-userena.git#egg=userena


Manual installation of development version with git.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Clone userena with::
    
    git clone git://github.com/bread-and-pepper/django-userena.git

You now have a directory ``django-userena`` which contains the ``userena``
application. You can add userena to your ``$PYTHONPATH`` by symlinking it. For
example::

    cd YOUR_PYTHON_PATH
    ln -s ~/src/django-userena/userena userena

Now userena is available to your project.

Required settings
-----------------

You need to make some changes Django settings if you want to use Userena in
your project. This means modifying ``AUTHENTICATION_BACKENDS``,
``INSTALLED_APPS`` and optionally ``MIDDLEWARE_CLASSES``.

Begin by adding ``userena``, ``guardian`` and ``easy_thumbnails`` to the
``INSTALLED_APPS`` settings of your project.

Next add :class:``UserenaAuthenticationBackend`` and :class:``ObjectPermissionBackend``, from
django-guardian, at the top of ``AUTHENTICATION_BACKENDS``. If you only have
Django's default backend, adding django-guardian and that of userena will get
the following::

    AUTHENTICATION_BACKENDS = (
        'userena.UserenaAuthenticationBackend',
        'guardian.backends.ObjectPermissionBackend',
        'django.contrib.auth.backends.ModelBackend',
    )

Profiles<commit_msg>UserenaAuthenticationBackend set in the right location.<commit_after>.. _installation:

Installation.
=============

Before install django-userena, you'll need to have a copy of `Django
<http://www.djangoproject.com>`_ 1.2 or newer installed.

For further information, consult the `Django download page
<http://www.djangoproject.com/download/>`_, which offers convenient packaged
downloads and installation instructions.

Installing django-userena.
--------------------------

You can install django-userena automagicly with ``easy_install`` or ``pip``. Or
manually placing it on on your ``PYTHON_PATH``.

I'm using `virtualenv <http://pypi.python.org/pypi/virtualenv>`_ to have an
isolated python environment. This way it's possible to create a tailored
environment for each project.

Automatic installation with easy_install.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Automatic install with `easy_install
<http://peak.telecommunity.com/DevCenter/EasyInstall>`_. All you have to do is
run the following command::

    easy_install django-userena

Manual installation with easy_install.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Clone the Git repository from Github. Then you can direct easy_install to the
``setup.py`` file. For ex.::

    git clone git://github.com/bread-and-pepper/django-userena.git
    cd django-userena
    easy_install setup.py


Automatic installation of development version with pip.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can tell `pip <http://pip.openplans.org/>`_ to install django-userena by
supplying it with the git repository on Github. Do this by typing the following
in your terminal::

    pip install -e git+git://github.com/bread-and-pepper/django-userena.git#egg=userena


Manual installation of development version with git.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Clone userena with::
    
    git clone git://github.com/bread-and-pepper/django-userena.git

You now have a directory ``django-userena`` which contains the ``userena``
application. You can add userena to your ``$PYTHONPATH`` by symlinking it. For
example::

    cd YOUR_PYTHON_PATH
    ln -s ~/src/django-userena/userena userena

Now userena is available to your project.

Required settings
-----------------

You need to make some changes Django settings if you want to use Userena in
your project. This means modifying ``AUTHENTICATION_BACKENDS``,
``INSTALLED_APPS`` and optionally ``MIDDLEWARE_CLASSES``.

Begin by adding ``userena``, ``guardian`` and ``easy_thumbnails`` to the
``INSTALLED_APPS`` settings of your project.

Next add :class:``UserenaAuthenticationBackend`` and :class:``ObjectPermissionBackend``, from
django-guardian, at the top of ``AUTHENTICATION_BACKENDS``. If you only have
Django's default backend, adding django-guardian and that of userena will get
the following::

    AUTHENTICATION_BACKENDS = (
        'userena.backends.UserenaAuthenticationBackend',
        'guardian.backends.ObjectPermissionBackend',
        'django.contrib.auth.backends.ModelBackend',
    )

Profiles
{'fraction_non_alphanumeric': 0.16304888152444078, 'fraction_numerical': 0.0006628003314001657, 'mean_word_length': 4.547794117647059, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2186147', 'n_tokens_mistral': 1748, 'n_tokens_neox': 1646, 'n_words': 578}