Преглед изворни кода

Istallation instruction added

master
Dirk Alders пре 2 месеци
родитељ
комит
db639339a5
1 измењених фајлова са 81 додато и 2 уклоњено
  1. 81
    2
      README.md

+ 81
- 2
README.md Прегледај датотеку

@@ -1,5 +1,84 @@
1 1
 # piki
2 2
 
3
-Piki is a minimal wiki
3
+Piki is a minimal wiki.
4 4
 
5
-# TODO: Add an installation instruction
5
+
6
+## Installation
7
+### Get the repository
8
+####Go to the subfolder, where you want to create your new Piki-Application (here ~/tmp)
9
+    cd ~/tmp
10
+#### Clone the repository
11
+    git clone https://git.mount-mockery.de/application/piki.git
12
+#### Change to your repository and initialise it completely
13
+    cd piki
14
+    git submodule init
15
+    git submodule update
16
+
17
+
18
+### Create your virtual environment
19
+#### Create python3 environment
20
+    python3 -m venv venv
21
+#### Activate the environment
22
+    source venv/bin/activate
23
+#### Install PaTT Requirements
24
+    pip install -r requirements.txt
25
+
26
+## Configuration and Initialisation of Piki
27
+### Create your config File
28
+#### Copy the config example
29
+    cp config_example/config.py .
30
+    chmod 700 config.py
31
+
32
+#### Set a secret key
33
+Edit config.py and add a SECRET_KEY. Generate the secret e.g by executing the following command:
34
+
35
+    python manage.py
36
+
37
+At the End of the error message you'll see a random secret:
38
+
39
+KeyError: "You need to create a config.py file including at least a SECRET_KEY definition (e.g.: --> **'HERE IS THE RANDOM SECRET ;-)'** <--)."
40
+
41
+
42
+
43
+### Create your initial database and first user for Patt
44
+    python manage.py migrate
45
+    python manage.py createsuperuser
46
+
47
+### Finalise Configuration
48
+Now there are two ways to finalise your configuration. The first way is for a test or development system. The other is for a production System.
49
+
50
+1. **Test or development System:** Edit config.py and set the Variable DEBUG to True.
51
+
52
+2. **Production System:** Edit config.py and set the Variable ALLOWED_HOSTS. Execute "python manage.py collectstatic" to create a folder including all static files. Then add PaTT to your server configuration. See also [Django Documnetation](https://docs.djangoproject.com/en/3.1/howto/deployment/) for further information.
53
+
54
+## Start the Test or development System
55
+### Go to the folder, where your PaTT-Application is locates (here ~/tmp/piki)
56
+    cd ~/tmp/piki
57
+
58
+###Activate your Virtual Environment
59
+    source activate
60
+
61
+###Start the Server
62
+    python manage.py runserver
63
+
64
+
65
+## Backup
66
+### Create Backup files
67
+    source venv/bin/activate
68
+    python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions -e patt --indent 2 > dump_base.json
69
+    python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions piki --indent 2 > dump_piki.json
70
+    tar -cvzf dump_data.tgz data/media data/pages
71
+
72
+### Restore Backup
73
+
74
+    source venv/bin/activate
75
+
76
+If you are starting without a database, you need to create one
77
+
78
+    python manage.py migrate
79
+
80
+Afterward add data step by step to the database.
81
+
82
+    python manage.py loaddata dump_base.json
83
+    python manage.py loaddata dump_patt.json
84
+    tar -xvzf dump_data.tgz

Loading…
Откажи
Сачувај