<p>For troggle itself, you need a linux machine. We all use Debian or Debian-derived machines (Debian itself, Ubuntu, Xubuntu etc.) but other forms of linux may work. Running Debian or Ubuntu under WSL on Windows 10 works fine.
<p>If you don't already know how to do this, then you should probably not be attempting this. But in case you are an experienced linux user who has always had someone else set up the system for them, then Ubuntu is the easiest and more forgiving to install, either directly on the computer or inside WSL. Because we are using fairly old releases of Django, you will want Ubuntu-20.04
<ul>
<li>Install in <ahref="https://docs.microsoft.com/en-us/windows/wsl/install">WSL on Windows 10</a>.
<p>and familiarise yourself with the directory structure on the expo server, which we will be duplicating (partly) as docmented in <ahref="serverconfig.html">The Expo Server</a>. We are not here doing a full install of all the software and scripts on the server, just the minimum to run, test and debug troggle on django.
<h3>WSL on Windows</h3>
<p>The standard documentation for Ubuntu or debian below all works, but you should first skim the
<ahref="../computing/winlaptop.html">Windows expo laptop</a> description of WSL1 and WSL2. The default
is that WSL2 will be installed, but all our practical experience so far is with WSL1.
<p>Python is not installed by default usually, and in any case we need specific versions to be installed. For Ubuntu 20.04 the default is python3.9 but this is incompatible with standard debian Buster, so we also need python3.7, if you are planning on migrating troggle from debian Buster (v10) to Bullseye (v11) then you will also want python3.8 .
and you will more easily be able to manage problems with incompatible versions of django plugins as installing and upgrading the dependent packages is very fast.
a <var>venv</var> specifically for python 3.7 (which is the standard version on our server which is running Buster (debian v10) and <ahref="https://docs.djangoproject.com/en/3.2/releases/2.2/">django 2.2.19</a>. See the <ahref="https://docs.python.org/3.7/library/venv.html">standard python dcoumentation on venv</a> for python 3.7.12. Note that we are creating it as a sibling folder to /troggle/ .
<pre><code>cd ~
cd ../expo
python3.7 -m venv py37d22
cd py37d22
source bin/activate
pip list -o</pre></code>
<p>The last command lists the default packages installed in the venv. This is for comparison later, after we
have installed troggle, django and dependencies. You will get a warning that you have an out of date version of pipbut this is as we want: we are using a version of pip appropriate for the older version of python within
<p>The first time you do this you can't complete the pip installation of django as you have not yet got the
dependencies - because you have not yet cloned the troggle repo, so the first time it is easiest to just create requirements.txt yourself with a text editor.
<pre><code>cp ../troggle/requirements.txt .
pip install -r requirements.txt
pip list -o</pre></code>
where <var>requirements.txt</var> (note the capitalisation of the listed packages) is:
<pre><code>confusable-homoglyphs==3.2.0
Django==2.2
docutils==0.14
gunicorn==20.1.0
Pillow==5.4.1
pytz==2019.1
sqlparse==0.2.4
Unidecode==1.0.23</pre></code>
This will pick up the latest django 2.2.x available, but all the other dependencies are pinned. These
dependencies are as-standard on debian Buster (10) and you will want to experiment with upgrading them
for Bullseye (v11).
<p>Pillow is an image handling package used to make
the prospecting map (currently disabled,
see <ahref="http://expo.survex.com/prospecting_guide/">/prospecting_guide/</a>).<br>
tinymce is the wysiwyg in-browser
editor (disabled pending reinstatement)
<p>This is also documented in the <ahref="trogdjangup.html">updating django for troggle page</a>
where it describes upgrading and testing with later versions of django.
<p>If you have not used pip before, read <ahref="https://linuxize.com/post/how-to-install-pip-on-ubuntu-20.04/">this</a>
<h3id="troginstall">Installing troggle</h3>
<dl><dt>key exchange</dt><dd>Follow this link to <ahref="../computing/keyexchange.html">register a key with the expo server</a> to get git access. </dd>
<dt>troggle</dt><dd>The <var>:troggle:</var> repo is the python code that runs troggle and generates 2,000 webpages of reports and tables. This is what you need for software development.<tt>cd /home/expo/p37d22<br>git clone ssh://expo@expo.survex.com/home/expo/troggle</tt> (read/write)</dd>