fix non django application loading

fix error introduced in 423e203db944ea5b250e2816cbeb9c4741cc736f.