Add the tomatoes to a blender and puree until smooth.
Heat the olive oil in a large saucepan over medium-high heat. Once hot, add the onions and saute until tender, about 5 minutes. Stir in the garlic and red pepper flakes and cook until the garlic is fragrant, about 1 minute. Add the tomatoes, bring to a boil, reduce the heat to a simmer and cook for 20 minutes. Stir in the basil the last minute of cooking.