Balancing intake of diverse nutrients is important for organismal growth, reproduction, and survival. A shift in an organism's optimal diet due to changes in nutritional requirements after developmental or environmental changes is referred to as dietary switch and has been observed in several species. Here we demonstrate that female Drosophila melanogaster also undergo a dietary switch following mating that leads to an increased preference for yeast, the major source of protein in their diet. We also demonstrate that S6 kinase (S6K) and serotonin production are involved in the postmating dietary switch. To further investigate the ability of D. melanogaster to balance nutrient intake, we examined the dietary preferences of adult flies following deprivation of yeast or sucrose. We observe that following conditioning on a diet deficient in either carbohydrates or yeast, D. melanogaster show a strong preference for the deficient nutrient. Furthermore, flies with activated dS6K or flies fed a serotonin precursor exhibit enhanced preference for yeast in this assay. Our results suggest that TOR signaling and serotonin may play an important role in maintaining nutrient balance in D. melanogaster. These studies may contribute to our understanding of metabolic disorders such as obesity and diabetes.