I have an untreated deviated septum and post nasal drip has been aggravating my lungs. And causing dark mucus with blood to come up randomly. Why?

Moisture is needed. Everyone has mucous in back of nose. If you are bothered by it it is because it is too thick (dry). Also dry nose will cause it to bleed. Deviated septum may cause turbulent airflow and worsen dryness. Hydrate, use humidifier, nasal saline spray, and you may try Guaifenesin 1200 mg twice daily to take with food and glass of water.
See E N T doctor. It is important that you should see a board certified e n t doctor, without delay. Let him/her examine you and advise.

Related Questions

Would post nasal drip from allergies and a deviated septum cause constant sticky clear mucus and occasional dark brown mucus with blood in it?

Maybe. The clear mucus is certainly consistent with allergic rhinitis. Deviated septum not involved with allergic symptoms. Occasional brown/blood may be small volume nosebleed tinging mucus or signs of sinus infection, both of which may involve the deviated septum to some degree.
No. Post nasal drip from allergies is common, and it can produce clear mucous. The deviated septum will not produce discharge. Someone should look to see if they can find the source of the bleeding. That is of concern.

How do you differentiate mucus from the lungs and mucus coming from deviated septum/post nasal drip?

Sometimes. Difficult. If you cough and there is immediate mucus production it may be obvious.
Symptoms & X-rays. The signs and symptoms are very different : sinusitis is typified by a stuffy nose and pain in the sinuses effected. Mucus from the lungs is typified by a deep cough and possible airway obstruction and difficulty breathing.

Can a deviated septum and constant nasal drip cause mucus to build up on your upper lungs?

Not usually. It is highly unlikely that the mucus would end up in your lungs. Typically it is swallowed.
Post nasal drip. Your deviated septum does not cause post nasal drip. You may have allergies or other issues. Have your nose evaluated by a board certified otolaryngologist.