Write, save, and export SQL queries from Django