django-public-holidays /

Filename Size Date modified Message
0 B
25 B
45 B
59 B
2.3 KB
834 B


A django app that contains tools and models for working with Public Holidays.


  • add public_holidays to your settings.INSTALLED_APPS

  • update the database tables for public_holidays:

    $ python syncdb


    $ syncdb

  • A new item will be created in your admin, which allows you to view and update public holidays.


A PublicHoliday object has a name, a date and a country. All of these are required, which does mean for something like Christmas Day, you may have many holidays on the same day, but this seemed like the best way to handle it.

A PublicHoliday may also have a list of provinces/states/districts (the name will depend upon the country selected), which are where the holiday is in effect. If no values exist in this list, that means the holiday applies to the whole country. The list of possible provinces is gleaned from django.contrib.localflavor, but if the country is not found in that app, you can enter your own values. This should be a python/json list of strings.

This app was written to allow one of my projects to determine if a given date was a public holiday for wage purposes. The employer/workplace also has an attribute which is a province, and this is used to see if a holiday in a certain country is active for this workplace.


You should have the following installed:

Basically, your pip REQUIREMENTS.txt file should contain lines similar to:

-e hg+
-e hg+
-e hg+