'can' and 'should' are two different things in my opinion. you can keep them in a rack and they might live and breed but you're taking a large, active, semi-arboreal and very intelligent snake and cooping it up in a tiny dark compartment... not really in the snake's best interest in my opinion.
just my $0.02