Julian Zelizer, a history and public affairs professor at Princeton University and a CNN political analyst, is the author of " The Fierce Urgency of Now: Lyndon Johnson, Congress, and the Battle for the Great Society ." He's co-host of the "Politics & Polls" podcast. The opinions expressed in this commentary are his own.

(CNN) Senator Bernie Sanders still thinks that the Democrats don't get it. Speaking Saturday in Chicago, Sanders offered some blistering rhetoric , calling on his supporters to take down President Trump, who he believes to be a threat to the nation.

But he also told a packed auditorium that targeting Trump was not enough.

"I am often asked by the media and others, 'How did it come about that Donald Trump, the most unpopular presidential candidate in the modern history of our country, won the election?'" Sanders said. "My answer is that Trump didn't win the election -- the Democratic Party lost the election."

The senator's warning to Democrats is extraordinarily important at this moment. While Republicans control the White House and Congress, Democrats are in a surprisingly good position. They face a Republican President whose term has been consumed by an ongoing scandal that keeps getting worse. His approval numbers are in the 30s and continue to fall.

Congressional Republicans have had trouble moving any signature legislation, and the bills they have managed to get through one chamber, such as health care, have made the party and president less popular. Midterm elections almost always go poorly for the party in power, and polls suggest that the 2018 midterms might fit the pattern.

Yet the danger for Democrats is that they lose sight of a basic problem the party has faced: the need for a stronger message to energize their base and broaden their reach. The risk for Democrats is that, like the rest of the nation, they become so consumed by the chaos in Washington that they don't devote any attention to cleaning up their own house and preparing for the next set of elections.

As Frank Bruni asks in The New York Times in looking at the town of Halcottsville in the 19th Congressional District of New York, "Will Democrats put forward the right candidate for a largely working-class region whose barns need paint, whose town centers want for bustle and whose manufacturing plants are too few and far between?"

So far President Trump's term has given Democrats a massive opening. The choices that he has made about public policy -- deregulating energy and financial markets, draconian health care changes that would leave millions of Americans with less health care coverage, a supply-side tax cut that would most benefit upper income Americans and the utter absence of a serious jobs policy -- have exposed the weaknesses and limitations of "conservative populism."

President Trump's fiery rhetoric belied the history of Republican politics in recent decades, which has not done much to benefit middle- and working-class Americans. Although Trump promised to be different, he is not.

Democrats, though, can't just say that President Trump is no good. In his most recent tweet , Trump said, "The Democrats have no message, not on economics, not on taxes, not on jobs, not on failing #Obamacare."

In response to this kind of attack that Republicans are likely to level against them in the years to come, Democrats must make a convincing case that their party actually has something to say about the ongoing economic insecurity that afflicts middle-class communities in a moment of low unemployment.

Some Democrats, such as New York Governor Andrew Cuomo, have tried to build on Sanders' appeal with new policy initiatives such as free higher education.

But state initiatives are not enough. National Democrats need to do more to outline and promote a robust domestic agenda that will reframe the midterm campaigns of 2018 and the presidential campaign of 2020. They have to demonstrate that they are a party that is not, in fact, beholden to big interests, as Sanders has argued, and has a vision that will translate into real economic gains for all Americans.

It will be vital that Democrats take these steps without dismissing the important issues that the party has embraced since the 1960s. Too many critics of the party reflexively blamed "identity" issues such as feminism and civil rights as the reason that Democrats like Hillary Clinton lost. That too would be a big mistake.

Rather than downplay questions such as criminal justice reform or equal pay, Democrats need to work harder to explain to voters why these are not "base" issues and why their agenda better responds to the concerns of the electorate living in red and blue states. They also need to make a more compelling case that only by dealing with issues such as sexism in the workplace or racism in policing can the nation actually craft policies that make all middle- and working-class Americans feel more secure about their futures.

Nor can Democrats leave foreign policy and national security on the sidelines. The problems that existed during President Obama's term -- the growth of ISIS, the expansion of Russian cyber and military aggression, and the turmoil in Syria -- have cost the party considerable support among voters who fear for the stability of the international order. The ease of criticizing President Trump's inchoate and stumbling moves around the globe do not excuse Democrats from coming up with a doctrine of their own.

President Trump has an ability to take up all the oxygen in the room. By the time his era of scandal, controversy and bombast comes to an end, many politicians in both parties won't even remember what they were planning to do when they went to work. The newsrooms are likewise so obsessed with Trump that it becomes extraordinarily difficult to give airtime to anything else.

A majority of Americans probably are not aware , for instance, that several trials will take place over the next few weeks of police officers who were caught on tape killing African Americans. These were videotaped acts that shook the nation's conscience last year but today barely receive a second of notice.

Follow CNN Opinion Join us on Twitter and Facebook

Democrats can't fell prey to this trap. Otherwise they won't be able to capitalize on this situation and navigate the political and policy challenges that will arise once President Trump is gone.

Historically, political parties thrive when they go through a process of self-examination and learn to better address policies they had ignored at a cost. In the 1930s, Franklin Roosevelt and congressional Democrats put forth a robust vision of using government in response to economic depression that revolutionized the role of the state in American life.

Democrats now face a similar kind of political crossroads. Whether they learn from 2016 and develop a more exciting set of policies, rather than coasting through 2018 on an anti-Trump message, will have as much impact on the party's future as Trump's fate in the months ahead.