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

Old description:

> 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).

New description:

 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).

 I'm happy to make any changes:
 https://github.com/django/django/pull/13655

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32180#comment:1>
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/063.afd4b9e3aaaff29bb8a1619fd959e466%40djangoproject.com.

Reply via email to