If your bankruptcy was just discharged, you typically have two years from that date to wait to loan. Plus, income qualification is probably going to be an issue and any job typcially has to be for at least 6 mos to 2 years to be considered stable income. There are some exceptions to that rule. And as said, your credit will play a part. However, a local bank may consider the loan as a personal loan or if you have a credit union, that may be an option.
If I were you, I would talk to the foreclosing bank to see if you could assume the mortgage of the owner or if they would loan to you. But I would start looking at rentals.