Except as otherwise provided by law, the cost of constructing, acquiring, or improving works of an improvement district shall be paid only out of the proceeds of an improvement district assessment levied upon and collected from the real property in the improvement district for such purposes.