Home > django-seasons

django-seasons

Django-seasons is a project mainly written in Python, it's free.

A simple Django app that adds a set of templatetags that produce colored coded Season tags based on date.


Copyright 2011 Wil black. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY WIL BLACK ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WIL BLACK OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Wil Black.


django-seasons provides a set of template tags to add color coded Season tags to any date in a template. The seasons are stored in the database. This requires you to run a ./manage.py syncdb upaon installation.

Configurable season parameters are name, color to use, start date, end date, and about text. The can be configured in the django backend.

Additionally a set of predifined season are available in defualts.py. These are the Northern Hemisphere four seasons, Summer, Spring, Winter, and Fall. They start and stop on the soltices and equinoxes.

**** INSTALLATION *****

  1. Download django-seasons

  2. Copy the seasons folder to you django project folder (where your other apps are).

  3. In settings.py add 'seasons' to your INSTALLED_APPS list.

  4. Run a ./manage.py syncdb to add the table seasons-season to the database.

  5. [Optional] Load the defaults seasons. In the django python shell run: from seasons.defualts import * load_seasons()

*** USAGE ****

  1. In the template you intent to use the seasons templatetags add {% load season_tags %} near the top.

  2. Then for any date you want the season of use the templatetag get_season. e.g. If 'entry_date' is a datetime object I can use {{ entry_date|get_season }}. This will render a color coded season tag on the page.