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.
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>
* needs_better_patch: 0 => 1
* component: Core (Cache system) => Core (System checks)
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/32180#comment:2>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/32180#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"721c95ba0b67eb46422dcf05a4274960e49c8894" 721c95ba]:
{{{
#!CommitTicketReference repository=""
revision="721c95ba0b67eb46422dcf05a4274960e49c8894"
Fixed #32180 -- Added system check for file system caches absolute
location.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32180#comment:4>