A state machine for Django