A newly built city can support 1 district.
At pop 4, it can support 2;
7,10,13,16,19,22,25, etc all add another district that can be supported:The formula is ceiling(population / 3)
Exceptions:
1. Aqueducts/Neighborhoods don't count.
2. Unique Districts don't count either.
3. Germany has the ability to build one more district than everyone else.
Bottom line is plan carefully if you want a spaceport in a city; the good news is it's relatively easy to grow late game, if not housing caped just place a farm adjacent to another farm, but if you are near the cap, add a neighborhood.