<commit_before>django-badgr
===========

A resuable [Django](http://www.djangoproject.com) application to display a [Flickr](http://www.flickr.com) badge.

django-badgr uses the [Flickr API](http://www.flickr.com/services/api/) to [search](http://www.flickr.com/services/api/flickr.photos.search.html) Flickr and return a user's most recent photos. The results are cached and stored in the Django context. The photo pool is then accessible as a template variable.


Requirements
------------

* [flickrapi](http://stuvel.eu/flickrapi) is used to interface with the Flickr API.


Installation
------------

1. Put the `badgr` directory somewhere inside your Python path (like in your Django project folder).
2. Add `badgr.context_processors.flickr` to your `settings.TEMPLATE_CONTEXT_PROCESSORS`.

   A good way to do this with overriding all of Django's default context processors is to first import the variable from the global settings and then append to it:

        from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS

        TEMPLATE_CONTEXT_PROCESSORS += (
            'badgr.context_processors.flickr',
        )


### Optional

If you want to take advantage of django-badgr's default template, add `badgr` to your `settings.INSTALLED_APPS`.


Usage
-----
<commit_msg>Improve installation and setup instructions<commit_after>django-badgr
===========

A resuable [Django](http://www.djangoproject.com) application to display a [Flickr](http://www.flickr.com) badge.

django-badgr uses the [Flickr API](http://www.flickr.com/services/api/) to [search](http://www.flickr.com/services/api/flickr.photos.search.html) Flickr and return a user's most recent photos. The results are cached and stored in the Django context. The photo pool is then accessible as a template variable.


Requirements
------------

* [flickrapi](http://stuvel.eu/flickrapi) is used to interface with the Flickr API.


Installation
------------

django-badgr is available on PyPI and can be installed with PIP.

    pip install django-badgr

Alternatively, you may download the source and install it.

    python setup.py install


Setup
-----

Add `badgr.context_processors.flickr` to your `settings.TEMPLATE_CONTEXT_PROCESSORS`.

    from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
    TEMPLATE_CONTEXT_PROCESSORS += (
        'badgr.context_processors.flickr',
    )


### Optional

If you want to take advantage of django-badgr's default template, add `badgr` to your `settings.INSTALLED_APPS`.


Usage
-----

{'fraction_non_alphanumeric': 0.11634349030470914, 'fraction_numerical': 0.0007914523149980214, 'mean_word_length': 3.7429643527204504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4163389', 'n_tokens_mistral': 792, 'n_tokens_neox': 730, 'n_words': 245}