The District has a problem — crisis, some might even say — with our local elections. But it is a crisis of our own making.

A poll by The Post last month showed that Mayor Vincent C. Gray, who is running for reelection, is ahead in a crowded Democratic field. But a mere 24 percent of Democratic voters backed him.

Over the past decade, no more than 38 percent of registered voters have bothered to turn out for any Democratic primary election, the de facto general election given that the District is essentially a one-party town.

With eight mayoral candidates competing in the April 1 primary, D.C. residents should be prepared for the possibility that far less than 40 percent of registered Democrats will select our next mayor. And a majority of those who participate will probably vote for someone other than the winner.

If the winner winds up with about 54,000 votes — or 40 percent support and turnout at 40 percent — he or she will have the firm support of about 12 percent of registered voters in the city. Some mandate.

Look no further than the 2012 primary to see how this could play out: Only 17 percent of registered Democrats took part in the April primary and, of those, just 40 percent voted for Vincent B. Orange, the eventual winner in the at-large race for D.C. Council. That means Orange secured his seat with the support of 23,719 out of about 462,000 registered voters, or a little more than 5 percent.

General elections are no help. By the time voters scan their ballots in November, the races for most of the offices have been decided. Their only real choice is whether to rubber-stamp the inevitable winners or cast protest votes for candidates without hope of victory. This exercise in futility offends basic democratic principles.

Voters are stuck in this predicament in part because the local Republican Party and Statehood-Greens have been on life support in the city since populists Carol Schwartz and Hilda Mason stopped appearing on the ballot. This year, the GOP and Statehood-Greens are contesting a minuscule number of offices. And while D.C. Libertarians are fielding six candidates, there are only 174 voters registered in the party.

There is a way we can reverse course. The District can adopt a nonpartisan election system in which candidates of any party affiliation, or none, run as a group in a single, open primary.

Under such a system, known as a top-two or blanket primary, any candidate who gets more than 50 percent of the vote wins outright. If no candidate reaches the 50 percent threshold, the top two vote-getters square off in a general election.

This would allow more registered voters to participate in a meaningful primary process (thereby increasing turnout) and attract more good candidates. It would create openings for Democrats with crossover appeal to independents, Republicans and others. And it would allow viable candidates who are hampered by their party affiliations, such as Patrick D. Mara (R) or Anne C. Wilcox (Statehood-Green), a chance to build winning coalitions on an even playing field.

This is not a radical concept. More than three-quarters of municipalities in the United States have a nonpartisan ballot, including Los Angeles, Chicago, Houston, Dallas, Atlanta, Seattle and Boston. Washington state and California have replaced partisan primaries with a top-two system. The U.S. Supreme Court voted 7 to 2 to uphold Washington’s top-two system, in 2008, and California voters approved the change in 2010, with the state conducting its first top-two primaries in 2012. California’s system has also withstood legal challenges.

The lack of electoral competition on low-turnout Primary Day may be good for Democratic Party leaders, but it’s not good for voters — including Democrats. Election law should be built to benefit voters, not parties or specific party leaders.

A simple solution exists: Allow all voters and all candidates equal access to the primary and general elections.

The writer has announced that he intends to run this fall as an independent candidate for D.C. Council in Ward 1.