Having tries to target two of these environments at the same time I can safely say the if you have to use a database etc. you end up having to write unique code for that environ
@Daren Thomas: I agree, but you should use the platform module to determine which interpreter you're running.