Backend settings are now the single source of truth for EBOOK_MAX_BYTES and BG_MAX_BYTES. A new context processor exposes them to all templates, and base.html injects them as window.DIORA_CONFIG so app.js reads from there instead of hardcoded values. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
331 B
Python
12 lines
331 B
Python
from django.conf import settings
|
|
|
|
|
|
def build_info(request):
|
|
return {'BUILD_TIME': getattr(settings, 'BUILD_TIME', '')}
|
|
|
|
|
|
def upload_limits(request):
|
|
return {
|
|
'EBOOK_MAX_BYTES': getattr(settings, 'EBOOK_MAX_BYTES', 10 * 1024 * 1024),
|
|
'BG_MAX_BYTES': getattr(settings, 'BG_MAX_BYTES', 5 * 1024 * 1024),
|
|
}
|