docm moved from README

This commit is contained in:
Philip Sargent 2021-10-29 22:35:52 +03:00
parent bd64c9cd47
commit 6d8c2f375d

View File

@ -187,7 +187,7 @@ The version number is the version of Django you have installed. Double check tha
<h4>do the basic troggle health checks</h4>
<p>Now try
<pre><code>python manage.py/code></code></pre>
<pre><code>python manage.py</code></code></pre>
You will get an error: No module named 'localsettings'. Fixing this is described below, but for now try:
@ -195,15 +195,50 @@ You will get an error: No module named 'localsettings'. Fixing this is described
<p>
The next task is to edit the SETTINGS files to match your machine and folder structure. So find the appropriate copy of the localsettings in /_deploy/ and copy it into the main troggle folder:
<pre><code>cp _deploy/wsl/localsettingsWSL.py localsettings.py</code></pre>
<p>Now edit it and insert useful values for EXPOUSERPASS [e.g. cavey:beery], EXPOADMINUSERPASS [e.g. beery:cavey], SECRET_KEY and make sure that LIBDIR refers to the actual version of python you are using (sorry, this should be automatic).
<p>Check that FILES and EXPOFILES are set to wherever you have put /expofiles/ or set 'EXPOFILESREMOTE = False' which will use expofiles on expo.survex.com instead.
The git repo copies have got munged passwords.
localsettings.py is not stored in git, but the copy on the server does have the correct passwords.
So use sFTP to download localsettings.py from expo.survex.com to get these.
<p>
We have at one time made localsettings in /_deploy/ appropriate for
<ul>
<li>debian (server install, not development)
<li>Ubuntu
<li>Ubuntu under WSL (Windows System for Linux)
<li>docker container
<li>potatohut (local network only)
</ul>
<p>
WARNING: only the WSL and debian variants are current in October 2021. All the others are so old that
they will need serious work to be useable. Copy what you need from WSL and debian variants of
localsettings.py
<p>Now edit localsettings.py and insert useful values for EXPOUSERPASS [e.g. cavey:beery], EXPOADMINUSERPASS [e.g. beery:cavey], SECRET_KEY. SECRET_KEY can be anything, it just has to be unique to each installation and invisible to anyone not a developer.
<p>Set <a href="https://docs.djangoproject.com/en/3.2/topics/email/#s-configuring-email-for-development">EMAIL_HOST and EMAIL_HOST_PASSWORD</a> to an email account you control that can send email. Then troggle can email you when some things go wrong. This may mean having to set EMAIL_PORT and MAIL_USE_TLS too (this is not used in troggle currently). Set EXPOUSER_EMAIL and EXPOADMINUSER_EMAIL to your own email address while you are doing software development. All these will be different when troggle is deployed on the public server.
<p>
Now you need to edit the following settings in your localsettings.py file to match your
development machine, e.g. if you have /expofiles/ mounted on another disc:
<pre><code>FILES = Path('/mnt/f/expofiles/')
EXPOFILES = Path('/mnt/f/expofiles/')</code></pre>
<p>
All the other settings (drawings, expoweb etc.) will work fine if they are parallel directories
to the directory you installed troggle into. The troggle code can find out itself where it
is living.
<p>
If you do not have a local copy of /expofiles/ (40 GB), you can use the expo server copy if
you set:
<pre><code>EXPOFILESREMOTE = TRUE</code></pre>
and then the FILES and EXPOFILES setings will be ignored.
<p>
Now try this again:
<pre><code>python manage.py</code></pre>
and in additon to the [django] command list, you will now gets command lists for [auth],
and in addition to the [django] command list, you will now gets command lists for [auth],
[contenttypes], [core], and [sessions]. These are the modules (plugins) loaaded into django.
[core] is the core of troggle (but not all of it: the input file parsers are not in [core]).
@ -279,6 +314,9 @@ python manage.py test -v 2
Yeah if you were paying attention, you will see that this has done a git commit for a test file
in the drawings repo locally.
Sorry about that. the test harness does not yet undo that. So you will need ot manually reverse that commit: go into your favourite git tool. In VS code the command is Commit: Undo last commit
If you have run the test suite several times you will need to undo several commits (and delete the files producd by the test suite).
</pre>
<p>The test suite has over 70 tests but does not cover all of what troggle does and does not use any real data. You need to manually test these too, after you have done a full data import:
<br>- <var><a href="http://localhost:8000/pathsreport">http://localhost:8000/pathsreport</a></var>