Files
octopus/myproject/products/apps.py

22 lines
921 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from django.apps import AppConfig
class ProductsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'products'
def ready(self):
"""
Подключаем сигналы при готовности приложения.
"""
import products.signals # noqa
# Регистрация декодеров HEIF/AVIF для Pillow (поддержка HEIC/HEIF/AVIF с iPhone и других устройств)
try:
from pillow_heif import register_heif_opener
register_heif_opener()
except ImportError:
# Плагин может отсутствовать в окружении — не ломаем запуск приложения
# HEIC/HEIF/AVIF тогда не будут поддерживаться до установки зависимостей
pass