from django.conf import settings
from .models import Category


def site_settings(request):
    """站点设置上下文处理器"""
    categories = Category.objects.all()
    return {
        'site_name': settings.SITE_NAME,
        'copyright_text': settings.COPYRIGHT_TEXT,
        'categories': categories,
    }