Initial commit: Django gallery project
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
12
gallery/context_processors.py
Normal file
12
gallery/context_processors.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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,
|
||||
}
|
||||
Reference in New Issue
Block a user