|
@@ -1,3 +1,104 @@
|
1
|
|
-# patt
|
|
1
|
+# PaTT
|
2
|
2
|
|
3
|
|
-Project And Teamorganisation Tool
|
|
3
|
+Project and Teamorganisation Tool
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+----
|
|
7
|
+## Installation
|
|
8
|
+----
|
|
9
|
+### Get the repository
|
|
10
|
+####Go to the subfolder, where you want to create your new PaTT-Application (here ~/tmp)
|
|
11
|
+ cd ~/tmp
|
|
12
|
+#### Clone the repository
|
|
13
|
+ git clone https://git.mount-mockery.de/application/patt.git
|
|
14
|
+#### Change to your repository and initialise it completely
|
|
15
|
+ cd patt
|
|
16
|
+ git submodule init
|
|
17
|
+ git submodule update
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+### Create your virtual environment
|
|
21
|
+#### Create python3 environment
|
|
22
|
+ virtualenv -p /usr/bin/python3 venv
|
|
23
|
+#### Activate the environment
|
|
24
|
+ source activate
|
|
25
|
+#### Upgrade all outdated packages
|
|
26
|
+ pip list -o --format freeze|cut -d '=' -f 1 | xargs pip install $1 --upgrade
|
|
27
|
+#### Install PaTT Requirements
|
|
28
|
+ pip install -r requirements.txt
|
|
29
|
+
|
|
30
|
+----
|
|
31
|
+## Configuration and Initialisation of PaTT
|
|
32
|
+----
|
|
33
|
+### Create your config File
|
|
34
|
+#### Copy the config example
|
|
35
|
+ cp config_example/config.py .
|
|
36
|
+ chmod 700 config.py
|
|
37
|
+
|
|
38
|
+#### Set a secret key
|
|
39
|
+Edit config.py and add a SECRET_KEY. Generate the secret e.g by executing the following command:
|
|
40
|
+
|
|
41
|
+ python manage.py
|
|
42
|
+
|
|
43
|
+At the End of the error message you'll see a random secret:
|
|
44
|
+
|
|
45
|
+KeyError: "You need to create a config.py file including at least a SECRET_KEY definition (e.g.: --> **'HERE IS THE RANDOM SECRET ;-)'** <--)."
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+### Create your initial database and first user for Patt
|
|
50
|
+ python manage.py migrate
|
|
51
|
+ python manage.py createsuperuser
|
|
52
|
+
|
|
53
|
+### Finalise Configuration
|
|
54
|
+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.
|
|
55
|
+
|
|
56
|
+1. **Test or development System:** Edit
|
|
57
|
+ config.py
|
|
58
|
+and set the Variable
|
|
59
|
+ DEBUG
|
|
60
|
+to
|
|
61
|
+ True.
|
|
62
|
+
|
|
63
|
+2. **Production System:** Edit
|
|
64
|
+ config.py
|
|
65
|
+and set the Variable ALLOWED_HOSTS. Execute
|
|
66
|
+ "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.
|
|
67
|
+
|
|
68
|
+----
|
|
69
|
+## Start the Test or development System
|
|
70
|
+----
|
|
71
|
+### Go to the folder, where your PaTT-Application is locates (here ~/tmp/patt)
|
|
72
|
+ cd ~/tmp/patt
|
|
73
|
+
|
|
74
|
+###Activate your Virtual Environment
|
|
75
|
+ source activate
|
|
76
|
+
|
|
77
|
+###Start the Server
|
|
78
|
+ python manage.py runserver
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+----
|
|
82
|
+## Backup
|
|
83
|
+----
|
|
84
|
+### Create Backup files
|
|
85
|
+ source venv/bin/activate
|
|
86
|
+ python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions -e patt --indent 2 > dump_base.json
|
|
87
|
+ python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions patt --indent 2 > dump_patt.json
|
|
88
|
+ tar -cvzf dump_media.tgz data/media
|
|
89
|
+
|
|
90
|
+**Further Files need to be backuped! **
|
|
91
|
+
|
|
92
|
+### Restore Backup
|
|
93
|
+
|
|
94
|
+ source venv/bin/activate
|
|
95
|
+
|
|
96
|
+If you are starting with any database, you need to create one
|
|
97
|
+
|
|
98
|
+ python manage.py migrate
|
|
99
|
+
|
|
100
|
+Afterward add data step by step to the database.
|
|
101
|
+
|
|
102
|
+ python manage.py loaddata dump_base.json
|
|
103
|
+ python manage.py loaddata dump_patt.json
|
|
104
|
+ tar -xvzf dump_media.tgz
|