Проблема с медиафайлами Django AWS S3

I’ve faced an issue while implementing S3 storage with Django application. Uploading the images through the Django admin panel to the S3 media folder works fine. However, I cannot retrieve the images from the S3 media folder (that is public) because of NotImplementedError: This backend doesn't support absolute paths. Please consider my files. Thank you for your support and attention.

settings.py

media_storages.py

# AWS S3 Media Files Configuration
from storages.backends.s3boto3 import S3Boto3Storage


class MediaStorage(S3Boto3Storage):
    location = 'media'
    file_overwrite = False

просмотр файла

from django.shortcuts import render
from django.views.decorators.http import require_GET

from app_catalog.models import ProductCategory


@require_GET
def categories(request):
    """
    Request           GET domain/catalog/categories/
    Description       The products' categories [HTML page]
    URL params        -
    Access            Public
    """
    object_ = ProductCategory.objects.get(id=1)

    context = {
        'url': object_.image.url,
    }

    return render(request, 'app_catalog/categories.html', context)

шаблонный файл


{% extends 'common/base.html' %}

{% block content %}

    <p>Image</p>
    {{ url }}

{% endblock %}
Вернуться на верх