President Obama has a few nuggets of political wisdom to share with hip-hop star Kanye West, who announced earlier this year at MTV's Video Music Awards that he had "decided in 2020 to run for president."

"In case Kanye is serious about this whole POTUS thing -- or, as he calls it, 'peezy' -- I do have advice for him," Mr. Obama told a large crowd gathered at San Francisco's historic Warfield theater on Saturday. "There's some stuff I've picked up along the way."

The president was speaking at a Democratic National Committee fundraiser, where West is scheduled to perform later in the evening. About 1,300 people were expected for the DNC event, where tickets ranged from a price tag of $250 to $10,000.

For his first piece of advice, the president acknowledged that "you've got to spend a lot of time dealing with some strange characters who behave like they're on a reality TV show." It was a not-so-subtle jab at the Republican contenders in the running for the White House and the field's front-runner, Donald Trump.

Get Breaking News Delivered to Your Inbox

"So," Mr. Obama said, "you've got to be cool with that."

"Second, saying that you have a beautiful, dark, twisted fantasy, that's what known as off-message in politics," the president said, referring to the rapper's chart-topping fifth studio album. "You can't say something like that. A lot of people have lost their congressional seats saying something like that. You don't do that."

But take it from Barack Obama: There's a tough road ahead to the White House.

The chief executive's third point for Mr. West: "Do you really think that this country is going to elect a black guy from the South Side of Chicago with a funny name to be president of the United States? That is crazy. That's cray!"

The president, playing to the crowd of DNC supporters, also touched on several of his administration's accomplishments.

"Together, we've made extraordinary progress," Mr. Obama said, ticking off a laundry list of what he considered his legislative successes. He touted Obamacare's expanded health care coverage, a nuclear deal with Iran, normalized relations with Cuba and the "longest uninterrupted job growth streak in our history."

But he also enumerated the tough policy fights ahead, focusing particularly on climate change and gun control.

On climate change, the president warned that "if we do not do something now, then we may not be able to deal with rising oceans, we may not be able to deal with increased drought."

The president also delivered a somber message on firearm regulations, with a fiery denunciation of the political gridlock surrounding gun control.

"This is not how it has to be," said Mr. Obama, who had flown to Roseburg, Oregon, Friday to comfort the families victimized by last week's mass shooting at Umpqua Community College. "This is a choice that we are making."

And, he urged, "we've got to make a different choice."

"These things aren't inevitable," Mr. Obama said. "These are things under our control. There are ways we can do that to protect our children and, yes, preserve the Constitution."

The president attended three Democratic fundraisers on Friday, including one for the re-election campaign of Sen. Patty Murray, D-Washington.

His schedule Saturday includes four more fundraisers, including the one in San Francisco, and three in Los Angeles.

According to CBS Radio News White House correspondent Mark Knoller, Saturday's four events bring the president's fundraiser count this year to 28. Twenty-three of the 2015 fundraisers were for the DNC, three for the Democratic Senatorial Campaign Committee and two for candidates and state parties.