utils.py 245 B

12345
  1. def handle_uploaded_file(file):
  2. file.name = "logo."+file.name.split('.')[1]
  3. with open('sharix_admin/static/sharix_admin/img/'+file.name, 'wb+') as destination:
  4. for chunk in file.chunks():
  5. destination.write(chunk)