Exactly. The original intention of TNG's creators was that the Enterprise would be on a long-term exploration mission into deep uncharted space, away from any Federation port for as much as 15 years at a time. It was meant to be a self-sustaining community, practically a small colony in its own right, as it would have to be in order to function on its own for that long.
The concept still seems hard to reconcile with space exploration as seen previously in TOS and later in TNG. Nomads, Doomsday Machines, giant space amoebae and so on make unexplored space seem like the last place one would want to send family members, or anyone not mission-essential.
Still, I don't buy the argument that all the danger the ship got into proved there shouldn't be families aboard. It got into constant danger because it was the setting of an action-adventure TV series. An action series set in New York or Boston or a small town in the middle of nowhere is going to have its characters placed in mortal danger just as often. (Look at the murder rate in Cabot Cove in Murder, She Wrote.) So even if you set a Star Trek series in San Francisco, the city would be under constant threat from alien attacks, technological disasters, strange mutated diseases, and so forth, because that's just the nature of an adventure series. But I don't think we'd hear fans saying that it was a bad idea for people living in cities to have families.
Living in a long-established community where dangerous things may happen is not the same as choosing to go into unknown situations where very dangerous things are known to happen.