cursor.execute(query_string, query_args)
col_names = [desc[0] for desc in cursor.description]
while True:
    row = cursor.fetchone()
if row is None:
    break
row_dict = dict(zip(col_names, row))
yield row_dict
return
posts = query_dicts(
    'SELECT * FROM tablename WHERE DAY(publish_date)<=%s AND MONTH(publish_date)=%s'
    , now.day, now.month)
Django date filter by day of month