<commit_before>=================
Django invitation
=================


This is a fairly simple user-invitation application for Django_,
designed to make allowing user signups as painless as possible
with quota restrictions: you need to be invited by someone else and
the number of invitations is limited by user.

.. _Django: http://www.djangoproject.com/


Overview
========

This application enables a common user-invitation workflow:

1. User fills out an invitation form, entering an email address.

2. An invitation key is created, and an invitation link is sent to
   the user's email address.

3. User clicks the invitation link, the
   user is able to register in and begin contributing to your site.

Various methods of extending and customizing the invitation process
are also provided.


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

In order to use django-invitation, you will need to have a
functioning installation of Django 1.0 or newer; due to changes needed
to stabilize Django's APIs prior to the 1.0 release,
django-invitation will not work with older releases of Django.

**The django-registration application is required in order to use 
django-invitation.**

Installing from a Mercurial checkout
------------------------------------

If you have `Mercurial`_ installed on your computer, you can also
obtain a complete copy of django-invitation by typing::

    hg clone http://code.welldev.org/django-invitation/

Inside the resulting "django-invitation" directory will be a
directory named "invitation", which is the actual Python module for
this application; you can symlink it from somewhere on your Python
path. Using a symlink offers easy upgrades: simply running ``hg pull -u``
inside the django-invitation directory will fetch updates from the
main repository and apply them to your local copy.

.. _Mercurial: http://www.selenic.com/mercurial/wiki/


Basic use
=========

To use the invitation system with all its default settings, you'll
need to do the following:

1. Add ``invitation`` to the ``INSTALLED_APPS`` setting of your
   Django project.

2. Add the setting ``ACCOUNT_INVITATION_DAYS`` to your settings file;
   this should be the number of days invitation keys will remain valid
   after an invitation is sent.

3. Create the necessary templates (see the section on templates below
   for details).

4. Add this line to your site's root URLConf **before registration urls**::
   
       (r'^accounts/', include('invitation.urls')),

5. Link people to ``/accounts/invite/`` so they can start inviting.


Templates used by django-invitation
===================================

The views included in django-invitation make use of five templates:

* ``invitation/invitation_form.html`` displays the invitation
  form for users to invite contacts.

* ``invitation/invitation_complete.html`` is displayed after the
  invitation email has been sent, to tell the user his contact has been 
  emailed.

* ``invitation/invitation_email_subject.txt`` is used for the
  subject of the invitation email.

* ``invitation/invitation_email.txt`` is used for the body of the
  invitation email.

* ``invitation/invite.html`` is displayed when a user attempts to
  register his/her account.

* ``invitation/wrong_invitation_key.html`` is displayed when a user
  attempts to register his/her account with a wrong/expired key.

Examples of all of these templates are not provided; you will need to
create them yourself.

Additionally, the URLConf provided with django-invitation includes
URL patterns for useful views in Django's built-in authentication
application -- this means that a single ``include`` in your root
URLConf can wire up invitation process.


How it works
============<commit_msg>Typo in documentation, thanks Zebuline<commit_after>=================
Django invitation
=================


This is a fairly simple user-invitation application for Django_,
designed to make allowing user signups as painless as possible
with quota restrictions: you need to be invited by someone else and
the number of invitations is limited by user.

.. _Django: http://www.djangoproject.com/


Overview
========

This application enables a common user-invitation workflow:

1. User fills out an invitation form, entering an email address.

2. An invitation key is created, and an invitation link is sent to
   the user's email address.

3. User clicks the invitation link, the
   user is able to register in and begin contributing to your site.

Various methods of extending and customizing the invitation process
are also provided.


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

In order to use django-invitation, you will need to have a
functioning installation of Django 1.0 or newer; due to changes needed
to stabilize Django's APIs prior to the 1.0 release,
django-invitation will not work with older releases of Django.

**The django-registration application is required in order to use 
django-invitation.**

Installing from a Mercurial checkout
------------------------------------

If you have `Mercurial`_ installed on your computer, you can also
obtain a complete copy of django-invitation by typing::

    hg clone http://code.welldev.org/django-invitation/

Inside the resulting "django-invitation" directory will be a
directory named "invitation", which is the actual Python module for
this application; you can symlink it from somewhere on your Python
path. Using a symlink offers easy upgrades: simply running ``hg pull -u``
inside the django-invitation directory will fetch updates from the
main repository and apply them to your local copy.

.. _Mercurial: http://www.selenic.com/mercurial/wiki/


Basic use
=========

To use the invitation system with all its default settings, you'll
need to do the following:

1. Add ``invitation`` to the ``INSTALLED_APPS`` setting of your
   Django project.

2. Add the setting ``ACCOUNT_INVITATION_DAYS`` to your settings file;
   this should be the number of days invitation keys will remain valid
   after an invitation is sent.

3. Create the necessary templates (see the section on templates below
   for details).

4. Add this line to your site's root URLConf **before registration urls**::
   
       (r'^accounts/', include('invitation.urls')),

5. Link people to ``/accounts/invite/`` so they can start inviting.


Templates used by django-invitation
===================================

The views included in django-invitation make use of five templates:

* ``invitation/invitation_form.html`` displays the invitation
  form for users to invite contacts.

* ``invitation/invitation_complete.html`` is displayed after the
  invitation email has been sent, to tell the user his contact has been 
  emailed.

* ``invitation/invitation_email_subject.txt`` is used for the
  subject of the invitation email.

* ``invitation/invitation_email.txt`` is used for the body of the
  invitation email.

* ``invitation/invited.html`` is displayed when a user attempts to
  register his/her account.

* ``invitation/wrong_invitation_key.html`` is displayed when a user
  attempts to register his/her account with a wrong/expired key.

Examples of all of these templates are not provided; you will need to
create them yourself.

Additionally, the URLConf provided with django-invitation includes
URL patterns for useful views in Django's built-in authentication
application -- this means that a single ``include`` in your root
URLConf can wire up invitation process.


How it works
============
{'fraction_non_alphanumeric': 0.09542395693135935, 'fraction_numerical': 0.003230148048452221, 'mean_word_length': 4.200139958012596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1153820', 'n_tokens_mistral': 1956, 'n_tokens_neox': 1869, 'n_words': 968}