Opened 9 years ago

Closed 9 years ago

#26240 closed Uncategorized (worksforme)

docs about cached.Loader thread safety unclear

Reported by: TZanke Owned by: nobody
Component: Documentation Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello,

in the documentation about the cached template loader, a warning box informs about thread safety concerns with template tags if using the cached template loader.
https://docs.djangoproject.com/en/1.9/ref/templates/api/#django.template.loaders.cached.Loader

After locking into the code of the loader i could not find anything related to multi thread template loading or anything like that.
https://github.com/django/django/blob/master/django/template/loaders/cached.py

So i think the cached loader is safe in a non-multi thread Django setup. The warning in the documentation is only relevant for multi thread setups of Django.

My recommendation:

Update the cached loader warning in the documentation to make clear, this only applies to multi thread Django setups.

Change History (1)

comment:1 by Tim Graham, 9 years ago

Resolution: worksforme
Status: newclosed

If you click through to the "for more information" link, it does say, "Since Django is sometimes run in multi-threaded..." This seems fine to me.

Note: See TracTickets for help on using tickets.
Back to Top