Fix is_django checking in some cases