In a pot or dutch oven, heat the oil. Add the onion and squash and cook, stirring occasionally, until the onions are soft, about 6 minutes.
Add the curry paste, garlic, ginger, turmeric and salt and cook for 1-2 minutes.
Add the lentils and broth and bring to a boil. Lower the heat and simmer until the lentils are soft and falling apart, about 20 minutes. Add the kale or spinach and stir until wilted, about 3 minutes. Top with cilantro, coconut flakes and lime juice, if using.