pakal / django-compat-patcher

A system to improve compatibility between different Django versions, and make upgrading dependencies less painful.
MIT License
13 stars 2 forks source link

settings compat #8

Closed jayvdb closed 4 years ago

jayvdb commented 4 years ago

Another minefield...

  File "/usr/lib/python3.8/site-packages/django/core/checks/registry.py", line 72, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/lib/python3.8/site-packages/morechecks/checks.py", line 13, in templates_do_not_do_queries
    processors = set(settings.TEMPLATE_CONTEXT_PROCESSORS)
  File "/usr/lib/python3.8/site-packages/django/conf/__init__.py", line 77, in __getattr__
    val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'TEMPLATE_CONTEXT_PROCESSORS'
pakal commented 4 years ago

Yes, project settings are considered to be under full control of the project owner, so DCP never touches them.

Legacy values like "TEMPLATE_CONTEXT_PROCESSORS" might be kept by the project owner (e.g. dynamically generated from the new "TEMPLATE"), just to please older libraries, since it doesn't require forking these external libs.