About cached temporary data¶
When you run a Lino application, Lino needs a place for storing temporary files like the SQLite database file, static files and dynamically generated files of miscellaneous types like .js, .pdf, .xls.
In a normal development environment this is simply below the project directory,
and those cache files are simply listed in the
But e.g. on Travis CI it is not allowed to write to the code repository.
In such situations you create an empty directory where you have write
permission, and then set the
LINO_CACHE_ROOT environment variable to
point to it.
The safest place for this directory is below your virtual environment:
$ cd ~/virtualenvs/a $ mkdir lino_cache
And then to add the following line to your
Don't forget to re-run the script in order to activate these changes. You can verify whether the variable is set using this command:
$ set | grep LINO
If an environment variable
LINO_CACHE_ROOT is set, then the cached
data of a Lino project (e.g. the
default.db files and the
media directory) are not written into the file tree of the source code
repository but below the given directory.
For example you can add the following line to your
Note that the path should be absolute and without a
When to update your static files¶
(This section is probably obsolete. Don't read.)
Lino comes with over 4000 static files, and together they take about 50 MB of
hard disk storage. To manage them, it uses Django's staticfiles app which
collectstatic command. Lino extends :manage:`
collectstatic` to build site cache files (by running :meth:`
<lino.core.renderer_mixin.JsCacheRenderer.build_site_cache>`) and build help
docs (by running
makehelp) as sub tasks before collecting the static
files into the specified common directory.
collectstaticcommand builds the site cache and help doc static files and copies them together with other miscellaneous static files to a central place where the web server will find them. This is standard Django know-how. See the documentation about the staticfiles app.
$ python manage.py collectstatic
Theoretically you need to do this only for your first local Lino
project, but you should run
after a Lino upgrade
when you changed your
if you use a plugin with static files for the first time
The following built-in plugins have static files:
You can run the
collectstatic command as often as you want.
So if you are in doubt, just run it again.
Some attributes of your
which are related to this topic:
Some Django settings related to this topic:
The root directory where static files are to be collected when the collectstatic command is run. See Django doc.
This is not needed as long as you work on a development server because the developement server serves static files automagically.
If this is not set, Lino sets an intelligent default value for it as follows.