The smartest way to budget a home is to start with what you can comfortably pay each month, then find the price that fits.
Take your target monthly payment, subtract taxes and insurance, then enter the rest into the mortgage calculator and adjust the home price until the payment matches.
A good rule of thumb is to keep housing under ~28% of your income, so an unexpected repair or rate change doesn't strain you.