编辑代码

import os
try:
    import django
except:
    os.system('python3 -m pip install django')
finally:
    import django