From 931aa4e3cba04382b8d8c94658c7a871c739be5b Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 14 May 2020 19:37:46 +0100 Subject: [PATCH] add mysql startup documentation --- README.txt | 26 ++++++++++++++++++++++---- parsers/people.py | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.txt b/README.txt index e666ebd..2680c22 100644 --- a/README.txt +++ b/README.txt @@ -25,14 +25,14 @@ smartencoding unidecode Install like this: -sudo apt install pip # does not work on WSL1 Ubuntu 20.04. Have to install from source +sudo apt install pip # does not work on Ubuntu 20.04. Have to install from source. Use 18.04 pip install django==1.7 pip install django-tinymce==2.0.1 sudo apt install libfreetype6-dev pip install django-registration==2.0 pip install unidecode -pip install --no-cache-dir pillow==2.7.0 # fails horribly on installing Ubuntu20.04 -pip install --no-cache-dir pillow # installs on Ubuntu20.04 , don't know if it works though +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 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. @@ -44,7 +44,25 @@ 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 +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; +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 Troggle itself ------------- @@ -66,7 +84,7 @@ import process. Setting up tables and importing legacy data ------------------------------------------ -Run "python databaseReset.py reset" from the troggle directory. +Run "sudo python databaseReset.py reset" from the troggle directory. Once troggle is running, you can also log in and then go to "Import / export" data under "admin" on the menu. diff --git a/parsers/people.py b/parsers/people.py index 32ab2c5..cb9f79f 100644 --- a/parsers/people.py +++ b/parsers/people.py @@ -138,7 +138,7 @@ def GetPersonExpeditionNameLookup(expedition): res = { } duplicates = set() - print("Calculating GetPersonExpeditionNameLookup for " + expedition.year) + #print("Calculating GetPersonExpeditionNameLookup for " + expedition.year) personexpeditions = models.PersonExpedition.objects.filter(expedition=expedition) htmlparser = HTMLParser() for personexpedition in personexpeditions: