What percentage of your net income should go towards a home mortgage?

Lets say you have $5000 coming in per month, how much is a safe amount to spend on a mortgage, while still saving some for car payments, other loans, insurance, groceries, emergencies, etc? My dad said a 1/4 of your net income is a good idea per month to spend on your home payments...agree? disagree?