We have a foreclosure on our record, and per the FHA guidelines, we are ineligible to qualify for a mortgage with FHA financing for 4 years after the date of the foreclosure. Bankruptcy will have similar guidelines (check with a mortgage broker to be sure, any of them can tell you what the rules are).
Immediately after our foreclosure, we had to find a place to rent. Because we had good credit other than our foreclosure (we had never been late on any payments except our mortgage), it was relatively easy to find a place to rent. A friend of mine had both a bankruptcy and a foreclosure on her record (due to a divorce that went badly) and she had a very hard time finding a place to rent. She stuck with it and did eventually find a nice house to rent, but it took some searching.
Good luck, and hang in there. It gets easier with time, as your credit score improves.