o
    wg                     @   s(   d dl mZ d dlZdd Zdd ZdS )    )FileSystemStorageNc                     sp   dd l  dd ld fddtdD } | d fddtdD 7 } t| } | d|}|S )Nr    c                 3       | ]	}  jV  qd S N)choiceascii_letters.0xrandomstring 6/var/www/html/lionshead-backend/panel_api/functions.py	<genexpr>       z/randomStringFunctionForImage.<locals>.<genexpr>   c                 3   r   r   )r   digitsr   r   r   r   r      r      )r   r   joinrangelistshuffle)str1sam_listfinalStringr   r   r   randomStringFunctionForImage   s   "

r   c                 C   sV   d}t |d}d}tj| jd }t }t|t| }||| }t|d | S )Nzmedia/user_profile)locationz/media/user_profile   /)r   ospathsplitextnamer   strsave)imagefullPathfs	fullPath2filetypetheNametheImageNamefilenamer   r   r   uploadTheProfile   s   
r.   )django.core.files.storager   r    r   r.   r   r   r   r   <module>   s    
