Integrate Django Image Crop Function to Azure Blob Storage
€30-250 EUR
In Progress
Posted about 3 years ago
€30-250 EUR
Paid on delivery
I am trying to move my media files to an azure file storage, however I'm finding an issue when trying to generate the cropped file as it is not being saved in the azure file storage.
Files in model file is as per the below:
class ImageShow ([login to view URL]):
title = [login to view URL](max_length=50)
image = [login to view URL](upload_to='homepage/images/')
active = [login to view URL](default=False)
cropping = ImageRatioField('image', '1200x400')
In template I'm calling it as per the below:
<img class="d-block w-100" src="{% cropped_thumbnail images "cropping" scale=1.0 %}">
and the below are the settings specified in [login to view URL]
from [login to view URL] import Settings as thumbnail_settings
THUMBNAIL_PROCESSORS = (
'image_cropping.thumbnail_processors.crop_corners',
) + thumbnail_settings.THUMBNAIL_PROCESSORS
As for Azure File Storage I have the below code:
In [login to view URL]
AZURE_ACCOUNT_NAME = ''
AZURE_ACCOUNT_KEY = ''
AZURE_CUSTOM_DOMAIN = f''
AZURE_LOCATION = ''
AZURE_CONTAINER = ''
MEDIA_URL = f'https://{AZURE_CUSTOM_DOMAIN}/{AZURE_LOCATION}/'
DEFAULT_FILE_STORAGE = '[login to view URL]'
In [login to view URL]
from storages.backends.azure_storage import AzureStorage
from [login to view URL] import settings
class AzureMediaStorage(AzureStorage):
location = settings.AZURE_LOCATION
file_overwrite = False
And in Urls I have the below code:
urlpatterns+= static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
I would like for someone to help me out make this work. Budget For this request is limited.
Thanks
Hello there, Hope you are doing well.
I have read your job description very carefully and I see you have some problems saving media files to Azure file storage.
As a senior python/django expert, I can help you right away and I am sure I can solve this problem perfectly for you.
Let's discuss more details via chat.
Regards