The method that used to circulate was a rewards-points scheme. You created an account on www.disneymovierewards.com, completed the promotional surveys and video offers to accumulate points, then redeemed 200 points for a Toontown membership code and entered that code in the game.
Two important caveats. First, completing promotional offers with false details is a straightforward way to get an account terminated, so if you go down this route, do it honestly. Second, and more decisively, Toontown Online was shut down in 2013 and Disney Movie Rewards has since ended, so the whole path no longer exists. Private server recreations are what former players use now.