The 1984 Democratic National Convention will be in San Francisco, as the party's site selection committee yesterday deferred to national Chairman Charles T. Manatt and other California Democrats who view it as a means of making inroads against the Republicans in the West.

"The Democratic party nationally is telling Mr. Reagan and Republicans that, "We're ready, Mr. President. We're ready to go into your back yard,"" said Rep. Tony Coelho (D-Calif.), chairman of the Democratic Congressional Campaign Committee. "We're going to contest every state."

San Francisco had been heavily favored to get the convention over the four other cities considered: Washington, Chicago, Detroit and New York.

Even so, California officials were still scrambling Wednesday evening to line up the 14 votes needed for a majority on the 27-member committee.

San Francisco fell one vote short of a majority on the first ballot, then swept to victory on the second ballot with 23 votes.

The District of Columbia, which made a spirited and well orchestrated bid, finished second on the first ballot, with five votes. Raymond Majerus, a United Auto Workers official from Wisconsin and chairman of the panel, held out for Detroit.

In San Francisco, Mayor Dianne Feinstein shouted, "Whoopie," after Manatt informed her by telephone of the committee's decision.

"I want you to know, Chuck, that we'll do you proud," said Feinstein "I think it's important that the convention be held in the West."

The timing of the decision was fortuitous for Feinstein, who is facing a recall election Tuesday.

D.C. Mayor Marion Barry said he was plesed with the District's showing and hoped to convince the Democrats to hold a midterm convention here in 1986.

"We came in second and we beat out the pros," Barry said. "Now I'm getting ready to go to San Francisco next year."

But Mayor Coleman Young of Detroit complained of Manatt's influence on the decision. He warned that "blood might be spilled" on San Francisco's streets, saying that he believes the city's police force is too small to handle the crowds of gay activists and other demonstrators certain to be drawn to the convention.

"It's probably the most volatile city in the United States, where you have all kinds of "isms' and schisms floating around," Young said. "It's an invitation to disaster."

Democratic Party officials, fearful of a repeat of the violence that marred the 1968 national convention in Chicago, pressured San Francisco to augment its 1,900-member police force with about 2,000 suburban and state police.

Richard J. Murphy, head of a technical advisory committee that assisted in the site selection, said that the city's pledge to double the number of police was crucial to the final decision.

The convention will run from July 16 to July 20 of next year, at the 650,000-square-foot Center in downtown San Francisco. The San Francisco Hilton will be the headquarters hotel.

The Republican National Convention is scheduled for Aug. 20-23 in Dallas.

San Francisco officials agreed to contribute a total of $8.6 million in financial incentives, security and transportation to the Democratic National Committee. That includes $2.5 million cash in city funds, $3 million for security costs, $1.5 million pledged by the business community, $250,000 for transportation and $235,000 in facility rentals.

Mayor-elect Harold Washington of Chicago, who helped launch a last-minute effort to get the Democratic convention for his city after his election last week, lobbied site selection officials at the Democratic Congressional Dinner Wednesday night.

Democratic officials had high praise yesterday for the efforts of Barry and Govs. Charles S. Robb of Virginia and Harry R. Hughes of Maryland to bring the convention to the District. About $500,000 was spent on the long-shot bid, including $200,000 in city funds.

"I think that a lot of people suddenly woke up to the idea that Washington is a very good place to hold a national convention," said Pamela Harriman, a prominent Democrat who chaired the city's effort to snare the convention.