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