It seems Mayor Bill de Blasio has decided to dine with the devil: His campaign is lobbying to do a town hall on . . . Fox News.

“We want to talk to all voters about why the mayor is the best candidate for working people — regardless of what news channel they watch,” de Blasio campaign spokeswoman Olivia Lapeyrolerie told The Post.

The move is controversial within the ranks of 2020 Democratic contenders. Bernie Sanders, Amy Klobuchar, Pete Buttigieg and Kirsten Gillibrand have each done a Fox town hall, but others say they never will. And the Democratic National Committee banned the network from hosting primary debates.

As for de Blasio: Last August, he warned CNN that the Murdoch media empire (which includes The Post as well as Fox News) is “dividing people and creating hatred and negativity and changing our political landscape for the worse.”

And he told The Guardian: “If you could remove [Murdoch’s] News Corp from the last 25 years of American history, we would be in an entirely different place . . . We would not be suffering a lot of the negativity and divisiveness we’re going through right now.”

Explaining the weak start of his presidential run, he whined that “Rupert Murdoch’s New York Post has been attacking me.”

But desperate times call for desperate measures. De Blasio is mired down in the polling-under-1-percent tier. Worse news was flagged in the headline of a chart on Nate Silver’s FiveThirtyEight site: “Democrats like candidates they know . . . except de Blasio.”

That is, he has a net negative approval rating among Dems who know who he is. Ouch.

So it’s Hail Mary time, with a bid for Fox. What’s next, a play for a Post endorsement?