2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 23:01:52 +00:00
troggle/README.txt

143 lines
5.0 KiB
Plaintext
Raw Normal View History

Troggle is an application for caving expedition data management, originally created for use on Cambridge University Caving Club (CUCC)expeditions and licensed under the GNU Lesser General Public License.
Troggle has been forked into two projects. The original one is maintained by Aron Curtis and is used for Erebus caves. The CUCC variant uses files as the definitive data, not the database and lives at expo.survex.com/troggle.
2011-07-11 02:10:22 +01:00
Troggle setup
==========
Python, Django, and Database setup
-----------------------------------
Troggle requires Django 1.4 or greater, and any version of Python that works with it.
2020-02-22 00:04:41 +00:00
It is currently (Feb.2020) on django 1.7.11 (1.7.11-1+deb8u5).
Install Django with the following command:
2011-07-11 02:10:22 +01:00
2020-02-22 00:04:41 +00:00
sudo apt install python-django (on debian/ubuntu) -- does not work now as we need specific version
2020-04-26 00:49:29 +01:00
requirements.txt:
Django==1.7.11
django-registration==2.1.2
mysql
#imagekit
2020-05-22 01:28:45 +01:00
#django-imagekit
2020-04-26 00:49:29 +01:00
Image
django-tinymce==2.7.0
smartencoding
unidecode
2020-02-22 00:04:41 +00:00
Install like this:
2020-05-22 01:28:45 +01:00
sudo apt install pip # does not work on Ubuntu 20.04 for python 2.7. Have to install from source. Use 18.04
2020-02-22 00:04:41 +00:00
pip install django==1.7
2020-04-26 00:49:29 +01:00
pip install django-tinymce==2.0.1
2020-02-22 00:04:41 +00:00
sudo apt install libfreetype6-dev
pip install django-registration==2.0
pip install unidecode
2020-05-14 19:37:46 +01:00
pip install --no-cache-dir pillow==2.7.0 # fails horribly on installing Ubuntu 20.04
pip install --no-cache-dir pillow # installs on Ubuntu 20.04 , don't know if it works though
2020-04-26 00:49:29 +01:00
If you want to use MySQL or Postgresql, download and install them.
However, you can also use Django with Sqlite3, which is included in Python and thus requires no extra installation.
pip install pygraphviz
apt install survex
pip install django-extensions
pip install pygraphviz # fails to install
pip install pyparsing pydot # installs fine
django extension graph_models # https://django-extensions.readthedocs.io/en/latest/graph_models.html
2011-07-11 02:10:22 +01:00
2020-05-24 13:35:47 +01:00
Or use a python3 virtual environment: (python3.5 not later)
2020-05-22 01:28:45 +01:00
$ cd troggle
$ cd ..
2020-05-24 13:35:47 +01:00
$ python3.5 -m venv pyth35d2
2020-05-22 01:28:45 +01:00
(creates folder with virtual env)
2020-05-24 13:35:47 +01:00
cd pyth35d2
2020-05-22 01:28:45 +01:00
bin/activate
(now install everything - not working yet..)
$ pip install -r requirements.txt
2020-05-14 19:37:46 +01:00
MariaDB database
----------------
Start it up with
$ sudo mysql -u -p
when it will prompt you to type in the password. Get this by reading the settings.py file in use on the server.
then
> CREATE DATABASE troggle;
> use troggle;
> exit;
2011-07-11 02:10:22 +01:00
2020-05-14 19:37:46 +01:00
Note the semicolons.
You can check the status of the db service:
$ sudo systemctl status mysql
You can start and stop the db service with
$ sudo systemctl restart mysql.service
$ sudo systemctl stop mysql.service
$ sudo systemctl start mysql.service
2011-07-11 02:10:22 +01:00
Troggle itself
-------------
Choose a directory where you will keep troggle, and git clone Troggle into it using the following command:
2011-07-11 02:10:22 +01:00
git clone git://expo.survex.com/troggle
2019-07-09 15:55:27 +01:00
or more reliably
git clone ssh://expo@expo.survex.com/home/expo/troggle
2011-07-11 02:10:22 +01:00
If you want to work on the source code and be able to commit, your account will need to be added to the troggle project members list. Contact wookey at wookware dot org to get this set up.
2011-07-11 02:10:22 +01:00
Next, you need to fill in your local settings. Copy either localsettingsubuntu.py or localsettingsserver.py to a new file called localsettings.py. Follow the instructions contained in the file to fill out your settings.
2020-03-14 20:08:44 +00:00
Setting up survex
-----------------
You need to have survex installed as the command line 'cavern' is used as part of the survex
import process.
2011-07-11 02:10:22 +01:00
Setting up tables and importing legacy data
------------------------------------------
2020-05-14 19:37:46 +01:00
Run "sudo python databaseReset.py reset" from the troggle directory.
2011-07-11 02:10:22 +01:00
2020-02-22 00:04:41 +00:00
2011-07-11 02:10:22 +01:00
Once troggle is running, you can also log in and then go to "Import / export" data under "admin" on the menu.
Adding a new year/expedition requires adding a column to the
folk/folk.csv table - a year doesn't exist until that is done.
2011-07-11 02:10:22 +01:00
Running a Troggle server
------------------------
2020-03-12 17:40:03 +00:00
For high volume use, Troggle should be run using a web server like apache. However, a quick way to get started is to use the development server built into Django. This is limited though: directory
redirection needs apache.
2011-07-11 02:10:22 +01:00
To do this, run "python manage.py runserver" from the troggle directory.
2020-03-12 17:40:03 +00:00
Running a Troggle server with Apache
------------------------------------
Troggle also needs these aliases to be configured. These are set in
/home/expo/config/apache/expo.conf
on the expo server.
At least these need setting:
DocumentRoot /home/expo/expoweb
WSGIScriptAlias / /home/expo/troggle/wsgi.py
2020-03-14 20:08:44 +00:00
<Directory /home/expo/troggle>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
2020-03-12 17:40:03 +00:00
Alias /expofiles /home/expo/expofiles
Alias /photos /home/expo/webphotos
Alias /map /home/expo/expoweb/map
Alias /javascript /usr/share/javascript
Alias /static/ /home/expo/static/
ScriptAlias /repositories /home/expo/config/apache/services/hgweb/hgweb.cgi
(The last is just for mercurial which will be remoived during 2020).
Unlike the "runserver" method, apache requires a restart before it will use
any changed files:
apache2ctl stop
apache2ctl start