Editor's note: Errol Louis is the political anchor at NY1, where he hosts "Inside City Hall," a nightly political show.
(CNN) -- Democrats, from the rank-and-file to President Obama, are worried -- as they should be -- about the surprise victory of a novice candidate, Republican Bob Turner, in New York City's 9th Congressional District.
Democrats had every advantage they could have asked for. They outnumber Republicans 3-to-1 in a district Dems have held since 1923. They vastly outspent Turner and the GOP, and even called in big guns like ex-President Bill Clinton and Gov. Andrew Cuomo to campaign for the losing Democrat, state Rep. David Weprin.
But they still lost.
It seems clear that voters, including a significant number of Democrats, are angry at Obama's policies -- so dissatisfied that they are willing to vote for newcomers, like Turner, who have never held political office. That was the driving dynamic of the 2010 elections, when the GOP gained 63 seats and control of the House of Representatives.
But the larger lesson to be drawn from the Turner victory is a basic one that the Democratic establishment appears to have forgotten or ignored: All politics is local. That well-known observation by former Speaker of the House Tip O'Neill has a New York City corollary: In the often-rowdy ethnic stew of America's most diverse city, all politics is tribal. The Democrats goofed on that, too.
As moderator of the only televised debate between Turner and Weprin, I was surprised at how little the candidates wanted to discuss local issues. The district includes a long stretch of oceanfront and portions of a national park area that had just been devastated by Hurricane Irene. It's exactly the kind of issue you'd expect a would-be congressman to pounce on, with pledges to land federal assistance for the park's cleanup, repair of a devastated boardwalk, and so on.
Neither man talked about it. Instead, they concentrated on debating Obama's budget policies and American policy toward Israel. That gave Turner an enormous advantage.
On the economy, bashing Obama put Turner squarely on the side of voters, 76% of whom, according to one national poll, think our country is on the wrong track, especially on economic matters. It also spotlighted an embarrassing gaffe by Weprin, a former banking regulator who boasted of his economic credentials but told an editorial board he believed America's debt is $4 trillion (the actual size is $14 trillion).
The issue of Israel was an even more potent one: The district is 40% Jewish and home to enclaves of deeply conservative congregations, many of them filled with immigrants from the former Soviet Union whose ancestral memories of religious oppression are part of their political and religious identity.
These voters aren't just pro-Israel, they are intensely, profoundly committed to the security of the Jewish state -- and enraged by Obama's reiteration of a longstanding U.S. policy that Israel should use its 1967 borders as a starting point for peace negotiations.
Weprin, the Democrat, is an observant Jew with deep ties to Israel, including relatives who live there. He is by no means anti-Israel, and it would have been logical for the district's Jewish voters to support him. But tribal appeals, by definition, are more about emotion than cool logic.
So when Jewish, Democratic ex-Mayor Ed Koch crossed party lines to endorse Turner -- and called for other Jewish Dems to follow suit as a way to send a message to Obama -- the message resonated. Prominent rabbis, who were already upset over Weprin's support for same-sex marriage, took Koch's move as another reason to support Turner, a conservative Catholic.
Weprin's strategy largely consisted of calling Turner a tea party candidate and pledging allegiance to the Democratic line, on the assumption that his party's election machinery and support from unions would win the day. That was a mistake in an overwhelmingly Democratic district that gave only 55% of its votes to Obama in 2008 -- one of the highest levels of Democratic defections outside of the Deep South.
Ironically, the Democrat who could have best explained the ins and outs of this odd swing district is Anthony Weiner, whose resignation after a sexting scandal left the seat vacant in the first place. Weiner's dozen years in Congress were largely characterized by a combination of hawkish stances on Israel and obsessive attention to mundane district needs.
The Weiner familiar to the outside world -- a fire-breathing liberal making constant appearances on cable talk shows -- had a very different identity at home, where he was best known as a workaday pol interested in catering to senior citizens, trying to secure ferry service for his waterfront constituents, and quickly blasting any perceived threat to Israel. A poll of the district showed that, even after the scandal that led to his resignation, a majority of Weiner's constituents didn't want him to quit.
National Democrats, including Team Obama, have their work cut out for them. Not only do they have to continue the fight to revive the economy in this election season, they have to get much smarter about how to tailor and target their positions, candidates and rhetoric to each of America's 435 congressional seats.
A one-size-fits-all approach might work for Obama himself, but when it comes to Congress, every district has its own peculiarities. And at that level, all politics is -- well, you know the rest.
The opinions expressed in this commentary are solely those of Errol Louis.