#32180: FileBasedCache accepts relative directorires as a LOCATION documentation
say should be absolute
-------------------------------------+-------------------------------------
               Reporter:  Carles     |          Owner:  Carles Pina Estany
  Pina Estany                        |
                   Type:             |         Status:  assigned
  Cleanup/optimization               |
              Component:  Core       |        Version:  master
  (Cache system)                     |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 FileBasedCache LOCATION: the documentation says that the path should be
 absolute, Django accepts absolute or relative.

 In https://docs.djangoproject.com/en/3.1/topics/cache/#filesystem-caching

 It says:
 "The directory path should be absolute – that is, it should start at the
 root of your filesystem."

 The code makes them absolute:
 
https://github.com/django/django/blob/master/django/core/cache/backends/filebased.py#L22

 Enforcing the LOCATION to be specified only in absolute way might have no
 gain and would have backwards compatibility problems for deployments that
 are passing the directory using a relative path.

 A possible way to improve the situation without or minimal backwards
 incompatibility changes would be to add a new check (thanks Carlton for
 the idea).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32180>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.b9c854c88bb50b4b357aede2ed99055e%40djangoproject.com.

Reply via email to