|
|
@@ -1 +1,48 @@
|
|
1
|
|
-# seum-counter
|
|
|
1
|
+# seum-counter
|
|
|
2
|
+
|
|
|
3
|
+## Installation
|
|
|
4
|
+
|
|
|
5
|
+Clone the repo, then create a `virtualenv` with Python 3, then install the required packages with :
|
|
|
6
|
+
|
|
|
7
|
+ pip install -r requirements.txt
|
|
|
8
|
+
|
|
|
9
|
+## Running the server
|
|
|
10
|
+
|
|
|
11
|
+### Developement
|
|
|
12
|
+
|
|
|
13
|
+Simply use the django command :
|
|
|
14
|
+
|
|
|
15
|
+ python manage.py runserver 0.0.0.0:8000
|
|
|
16
|
+
|
|
|
17
|
+### Production
|
|
|
18
|
+
|
|
|
19
|
+Install the packages needed to run an Apache server with `wsgi_mod` :
|
|
|
20
|
+
|
|
|
21
|
+ sudo apt-get install apache2 libapache2-mod-wsgi-py3
|
|
|
22
|
+
|
|
|
23
|
+Then add the following content to the file `/etc/apache2/sites-available/000-default.conf`, inside the `<VirtualHost>` tag :
|
|
|
24
|
+
|
|
|
25
|
+ Alias /static <path-to-project-folder>/static
|
|
|
26
|
+ <Directory <path-to-project-folder>/static>
|
|
|
27
|
+ Require all granted
|
|
|
28
|
+ </Directory>
|
|
|
29
|
+
|
|
|
30
|
+ <Directory <path-to-project-folder>/seum>
|
|
|
31
|
+ <Files wsgi.py>
|
|
|
32
|
+ Require all granted
|
|
|
33
|
+ </Files>
|
|
|
34
|
+ </Directory>
|
|
|
35
|
+
|
|
|
36
|
+ WSGIDaemonProcess seum python-path=<path-to-project-folder>:<path-to-project-folder>/<name-of-virtualenv>/lib/python3.5/site-packages
|
|
|
37
|
+ WSGIProcessGroup seum
|
|
|
38
|
+ WSGIScriptAlias / <path-to-project-folder>/seum/wsgi.py
|
|
|
39
|
+
|
|
|
40
|
+To give Apache the permission to serve the files, execute these three commands :
|
|
|
41
|
+
|
|
|
42
|
+ chmod 664 <path-to-project-folder>/db.sqlite3
|
|
|
43
|
+ sudo chown :www-data <path-to-project-folder>/db.sqlite3
|
|
|
44
|
+ sudo chown :www-data <path-to-project-folder>
|
|
|
45
|
+
|
|
|
46
|
+To launch or restart the server, simply run :
|
|
|
47
|
+
|
|
|
48
|
+ sudo service apache2 restart
|