In short, yes you can get a mortgage with debt. How much debt however, is important.
One of the keys to getting a mortgage is the affordability formula, or the debt service ratios/calculations.
If you meet these guidelines, then absolutely you will be able to get a mortgage, no matter the sum of your debt.
There are of course, other factors to also take into consideration, in addition to how much income you earn.
if you have sufficient assets that, in the case of an emergency, you can fall back on to maintain payments.
There are also alternative lending options that have looser guidelines when it comes to the debt service ratios.
They calculate the debt obligations differently, depending on the type of debt (another mortgage for instance, on an income generating property).
There are no short cuts, the only way to truly find out is by doing an application and running the numbers.
One other key aspect of this, when you are applying for a mortgage, if the debt you are talking about is say a car payment or a lease. This will impact the amount of a mortgage that you can afford.
If you go and get a vehicle loan or lease for example, once you have your mortgage in place and are living in your home for a while, the mortgage does not impact how much of a car loan or lease you can get.
So it impacts the mortgage if you get it before the mortgage, but the mortgage does not impact it if you get the mortgage first.
Why? Well that really is a topic for a different day.