Skip to content

Commit

Permalink
docs: CACHE_DIR documentation
Browse files Browse the repository at this point in the history
- Fixed example configration to match CACHE_DIR usage
- Move DATA_DIR sections which now live in CACHE_DIR
- Document new CACHE_DIR entries
- Document change in the upgrading instructions

Fixes #9601
  • Loading branch information
nijel committed Aug 1, 2023
1 parent 4a3cd04 commit 63a2f22
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 17 deletions.
15 changes: 11 additions & 4 deletions docs/admin/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@ network filesystem.

The Docker container uses a separate volume for this, see :ref:`docker-volume`.

The following subdirectories usually exist:

:file:`fonts`
:program:`font-config` cache for :ref:`fonts`.
:file:`avatar`
Cached user avatars, see :ref:`avatars`.
:file:`static`
Default location for static Django files, specified by :setting:`django:STATIC_ROOT`. See :ref:`static-files`.
:file:`tesseract`
OCR trained data for :ref:`screenshots`.

.. setting:: CSP_SCRIPT_SRC
.. setting:: CSP_IMG_SRC
.. setting:: CSP_CONNECT_SRC
Expand Down Expand Up @@ -394,10 +405,6 @@ The following subdirectories usually exist:
Home directory used for invoking scripts.
:file:`ssh`
SSH keys and configuration.
:file:`static`
Default location for static Django files, specified by :setting:`django:STATIC_ROOT`. See :ref:`static-files`.

The Docker container uses a separate volume for this, see :ref:`docker-volume`.
:file:`media`
Default location for Django media files, specified by :setting:`django:MEDIA_ROOT`. Contains uploaded screenshots, see :ref:`screenshots`.
:file:`vcs`
Expand Down
4 changes: 2 additions & 2 deletions docs/admin/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1206,14 +1206,14 @@ Serving static files
Django needs to collect its static files in a single directory. To do so,
execute :samp:`weblate collectstatic --noinput`. This will copy the static
files into a directory specified by the :setting:`django:STATIC_ROOT` setting (this defaults to
a ``static`` directory inside :setting:`DATA_DIR`).
a ``static`` directory inside :setting:`CACHE_DIR`).

It is recommended to serve static files directly from your web server, you should
use that for the following paths:

:file:`/static/`
Serves static files for Weblate and the admin interface
(from defined by ``STATIC_ROOT``).
(from defined by :setting:`django:STATIC_ROOT`).
:file:`/media/`
Used for user media uploads (e.g. screenshots).
:file:`/favicon.ico`
Expand Down
1 change: 1 addition & 0 deletions docs/changes/v4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Please follow :ref:`generic-upgrade-instructions` in order to perform update.
* The deprecated VCS setting for credentials is no longer supported, see :ref:`up-4-14`.
* Upgrade of `django-crispy-forms` requires changes in :setting:`django:INSTALLED_APPS`.
* Integration of `django-cors-headers` requires changes in :setting:`django:INSTALLED_APPS` and :setting:`django:MIDDLEWARE`.
* Introduction of :setting:`CACHE_DIR` changed default value of :setting:`django:STATIC_ROOT`. You might need to adjust :ref:`static-files` accordingly.

Weblate 4.15.2
--------------
Expand Down
6 changes: 3 additions & 3 deletions weblate/examples/apache-path.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
ServerName weblate.example.org

# DATA_DIR/static/favicon.ico
Alias /weblate/favicon.ico /home/weblate/data/static/favicon.ico
Alias /weblate/favicon.ico /home/weblate/data/cache/static/favicon.ico

# DATA_DIR/static/
Alias /weblate/static/ /home/weblate/data/static/
<Directory /home/weblate/data/static/>
Alias /weblate/static/ /home/weblate/data/cache/static/
<Directory /home/weblate/data/cache/static/>
Require all granted
</Directory>

Expand Down
6 changes: 3 additions & 3 deletions weblate/examples/apache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
ServerName weblate.example.org

# DATA_DIR/static/favicon.ico
Alias /favicon.ico /home/weblate/data/static/favicon.ico
Alias /favicon.ico /home/weblate/data/cache/static/favicon.ico

# DATA_DIR/static/
Alias /static/ /home/weblate/data/static/
<Directory /home/weblate/data/static/>
Alias /static/ /home/weblate/data/cache/static/
<Directory /home/weblate/data/cache/static/>
Require all granted
</Directory>

Expand Down
6 changes: 3 additions & 3 deletions weblate/examples/apache.gunicorn.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
ServerName weblate.example.org

# DATA_DIR/static/favicon.ico
Alias /favicon.ico /home/weblate/data/static/favicon.ico
Alias /favicon.ico /home/weblate/data/cache/static/favicon.ico

# DATA_DIR/static/
Alias /static/ /home/weblate/data/static/
<Directory /home/weblate/data/static/>
Alias /static/ /home/weblate/data/cache/static/
<Directory /home/weblate/data/cache/static/>
Require all granted
</Directory>

Expand Down
4 changes: 2 additions & 2 deletions weblate/examples/weblate.nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ server {

location ~ ^/favicon.ico$ {
# DATA_DIR/static/favicon.ico
alias /home/weblate/data/static/favicon.ico;
alias /home/weblate/data/cache/static/favicon.ico;
expires 30d;
}

location /static/ {
# DATA_DIR/static/
alias /home/weblate/data/static/;
alias /home/weblate/data/cache/static/;
expires 30d;
}

Expand Down

0 comments on commit 63a2f22

Please sign in to comment.