The better person to ask that question would be a potential landlord. It depends on the landlord.
I happen to be a landlord myself, and if a person comes to me looking to file bankruptcy, I know two things. First, they don’t have all that debt to compete with their ability to pay the rent. Second, they can’t file bankruptcy for another 8 years, so I don’t have to worry about them breaking the lease and filing on me. So actually, you are really a better risk after you file than you are right now!
What I would suggest, is that you check around with some prospective landlords – just look on Craigslist or wherever, and ask what their policy is. My hunch is that some of the bigger institutional complexes, or maybe places that have management companies without discretion, MIGHT have a waiting period after bankruptcy. But most mom & pop-type landlords who do their own screening won’t have an issue. And of course, when it comes down to it, money talks – it would be very rare for a landlord to turn away someone who can pay a few months up front.
In 25 years as a bankruptcy attorney, I’ve never had a former client tell me that their bankruptcy prevented them from finding housing. And I have helped A LOT of people who were in the process of losing their homes when they filed.