Get tuple of the first and last days of the last N months
def last_n_months(n=12, ending=None):
    """Return a list of tuples of the first/last day of the month
    for the last N months    
    """
    from datetime import date
    from dateutil.rrule import rrule, MONTHLY
    from dateutil.relativedelta import relativedelta


It is better to import outside of the function. Typically imports go at the top of the file.

    if not ending:


You should check for none like: if ending is not None: just to be explicit about what you are checking for.

        ending = date.today()

    # set the ending date to the last day of the month
    ending = ending + relativedelta(months=+1, days=-ending.day)


Modifying ending rubs me the wrong way. 

    # starting is the first day of the month N months ago
    starting = ending - relativedelta(months=n, day=1)

    months = list(rrule(MONTHLY, bymonthday=(1, -1), dtstart=starting,
                        until=ending))

    # we return pairs of dates like this: (1st day of month, last day of month)
    months = zip(months[::2], months[1::2])

    return months


You can combine these two lines