from pwdselfservice import settings # /root/桌面/ad-password-self-service/static/img UPLOAD_ROOT = os.path.join(settings.BASE_DIR,'static/img') # my_os=os.path.abspath(UPLOAD_ROOT) print(my_os) #/root/桌面/ad-password-self-service/static/img os.remove(os.path.abspath(UPLOAD_ROOT)+'//'+'unlock.jpg') # 删除操作