start = datetime.strptime(startDate, '%Y-%m-%d').date()
end = datetime.strptime(endDate, '%Y-%m-%d').date()
cur_date = start
while cur_date < end:
    print(cur_date)
cur_date += relativedelta(months=1)
How to display all the months between given two dates?