When I started asking about the prospect of serving local food as school lunches, I got two conflicting messages.

The first message was exuberantly optimistic: By going straight to the farmer, schools could get regional, delicious, and healthy food at the same prices they were getting the normal mystery meat and “barfaroni.” This is good for the students, and it’s even better for the farmers. When Oakland Unified School District served California chorizo with local kale, “They used literally tons of organic kale, just from one lunch,” Zenobia Barlow, executive director of the Center for Ecoliteracy, told me.

The second message was very different: We just spend too little on school lunches to make them environmentally and physically healthy. Alexandra Emmott, farm to school supervisor at the Oakland Unified School District, has just 60 cents to create an entrée — and that, or less, is the norm around the country. “Food service is the only part of school that needs to run like a business and break even,” Emmott said. “We don’t expect the math classes to make a profit, that’s just something our society has decided is worth supporting. Why not make that same investment in feeding our children?”

Haile Johnston, of Common Market — which has helped over 50 schools in the Philadelphia area get food from local farms — echoed this sentiment. “We should be dedicating more resources so we can feed our children better quality calories, rather than just giving them the byproducts of subsidized agriculture.”

So which is it? If there’s just not enough money to feed kids quality, regional ingredients, it can’t also be true that it’s possible to serve food from local farmers without raising costs.

It seems like you should be able to buy fresh local meat and vegetables at lower prices than frozen pizza — and you can. But that’s like saying you can buy steel for less than you can buy a car. It’s the processing that costs money. When you get food right from the farm, it takes some work to cook it — whereas the cooking of chicken tenders is largely automated, and very cheap.

In mid-February, Sarah Fritschner, the coordinator of Louisville Farm to Table, was feeling frustrated and defeated. She’d been working hard to get butternut squash from Kentucky farmers onto students’ plates, but at that moment it seemed like it was never going to work out. Farmers in Kentucky have historically made a lot of their money growing tobacco, and Fritschner’s goal has been to help those farmers thrive by producing something healthier. Squash fits the bill: It grows well in the state, it’s dense with nutrients, and schools have a mandate from the federal government to serve more orange and leafy green vegetables. Squash seemed like a perfect fit.

Fritschner worked with a food processor to make a butternut squash chili, and the kids loved it. But there was a big problem: The amount schools could pay for the chili only covered half of the costs. And, Fritschner wrote, “The most expensive ingredient in it? Local butternut squash.”

Fritschner was feeling pretty low when she wrote the blog entry telling this story. It’s entitled, “We can’t afford local.”

“I go through my ups and downs, and that day was certainly a down,” she said. “Then I’ll figure something out, then I’ll hit another wall.”

It’s not that Fritschner really believes we can’t afford local food — it’s just that making the numbers work is hard. “There’s a lot of people saying that local food is inexpensive and wonderful,” she said, “but when it comes to actually solving these problems sometimes I feel like I’m all alone. I’d just like some more heads working on this.”

I spoke to Fritschner again a few days later and she was on the upswing: If she was able to guarantee a larger volume, the processor could lower his price a little. And then, if he put a little less squash in the chili, it would be affordable. But there was another problem: It turned out that, if the cubed squash fell apart in the chili, it wouldn’t count toward the federal requirements for vegetables. “But pizza can count for the tomato sauce!” she said.

You can beat down the price, but it takes a lot of work to figure it out. “Food processors have to be on board,” Fritschner said. “They use man hours to figure this out and make mistakes.”

Upending the school lunch system may be easier in places where food processors aren’t part of the picture. In the old days, many schools did their own cooking.

“School lunches have devolved to mostly heat-and-serve operations,” said Johnston. “The food staff is making lunch using box cutters and can openers. There’s a tremendous amount of lost knowledge and capacity among school kitchens.”

But that tide seems to be turning. Many of the biggest school districts are doing more of their own cooking now. Oakland Unified School District is building a new central kitchen, which will help it reduce processing costs and make raw ingredients a little more affordable. Oakland passed a $475 million bond measure to pay for that facility, and to allow the schools the financial wiggle room to experiment with new recipes. With that help, Emmott found she could serve a meal of tofu, soba noodle, and bok choi — all regionally produced — for the same budget as, say, chicken nuggets. But she’s also had missteps. Those tons of kale that she bought broke her budget. It wasn’t that the kale itself was expensive, but someone had to strip the leaves off the fibrous stem, and that processing put it over the top.

That experience also taught Emmott that she might be able to improve the financial picture through marketing. It may seem strange to advertise school lunches to students, but if more kids buy lunch it amounts to more revenue, and more money to work with. “When I told people that we were serving organic, Capay Valley kale, they were shocked,” Emmott said.

Marketing has been the key to success for Scott Soiseth, the Director of Child Nutrition at Turlock Unified School District in California’s San Joaquin Valley. By marketing the school food around the brand “Real Fresh,” Turlock more that tripled the number of students participating in the lunch program, and increased revenue from $4.5 million to $5.8 million. That allowed Soiseth to pay more for better quality ingredients.

“Participation drives quality, and quality drives participation,” he said. Now he can afford to spend a dollar per entrée, and can cover the cost of local grass-fed beef and free-range chicken. Soiseth buys more than 80 percent of the food from within a 200-mile radius, though he acknowledges that he has an unfair advantage: Turlock is in the middle of the richest farmland on earth. “I’d be foolish if I didn’t use it,” he said. “I can get anything here in California.”

So in the end, can school kids really eat local without breaking the bank? Soiseth insists that they can. “I really disagree when people say we need more help from the federal government,” he said. “We can feed kids a really nice meal for what we get and cover all the costs.”

He allows, however, that it’s not always easy, and that he needed about $200,000 up front to make the changes. Like everyone else, he ran up against obstacles and made mistakes. And perhaps it’s more expensive to get real fresh food in places like Kentucky and Michigan than it is in California.

But sometimes even what feels like a failure is also a success. After serving that expensive kale chorizo, Emmott got an email from one of the school cafeteria managers. When she hears from the cafeteria managers, it’s usually because they had a problem with the food she sent their way. “It’s never good,” she said. “I rarely get positive emails.”

This one was written in all caps and opened with: “OMG!!! THAT WAS THE BEST DISH EVER.”