from django.core.files.storage import FileSystemStorage
import os
from admin_panel.common_functions import *
import random,string

def uploadTheProfile(image):

	fullPath='media/user_profile'
	fs = FileSystemStorage(location=fullPath)
	fullPath2='/media/user_profile'
	filetype = os.path.splitext(image.name)[1]
	theName=randomStringFunctionForImage()
	theImageName=str(theName)+str(filetype)
	filename = fs.save(theImageName, image)
	return str(fullPath2)+'/'+filename