
    h                     4    d dl mZ d dlZd dlZd dlZd Zd Zy)    )FileSystemStorageNc                     dd l dd ldj                  fdt        d      D              } | dj                  fdt        d      D              z  } t	        |       } j
                  |       dj                  |      }|S )Nr    c              3   V   K   | ]   } j                   j                         " y wN)choiceascii_letters.0xrandomstrings     7/var/www/html/Kila-kolis-project/Kolis/userapi/utils.py	<genexpr>z/randomStringFunctionForImage.<locals>.<genexpr>   s#     Ghv334h   &)   c              3   V   K   | ]   } j                   j                         " y wr   )r   digitsr
   s     r   r   z/randomStringFunctionForImage.<locals>.<genexpr>	   s!     A1-&--.r      )r   r   joinrangelistshuffle)str1sam_listfinalStringr   r   s      @@r   randomStringFunctionForImager      sf    
GeAhGHAaA	BBJwwx     c                    d}t        |      }d}t        j                  j                  | j                        d   }t               }t        |      t        |      z   }|j                  ||       }t        |      dz   |z   S )Nzmedia/usermedia)locationz/media/usermedia   /)r   ospathsplitextnamer   strsave)imagefullPathfs	fullPath2filetypetheNametheImageNamefilenames           r   uploadTheProfiler1      sq    
*GGUZZ(+	%	''l3x=(GGL%(Is8##r   )django.core.files.storager   r#   r   r   r   r1    r   r   <module>r4      s    7 	 	$r   