104 lines
1.7 KiB
Markdown
104 lines
1.7 KiB
Markdown
# SIKWEB 2.0
|
|
|
|
## Accessing the source
|
|
|
|
### Clone this repository and enter it
|
|
|
|
Set up your SSH key authentication in GitLab Profile Settings. Then clone the repository:
|
|
|
|
```
|
|
git clone git@sika.sahkoinsinoorikilta.fi:vtmk/web2.0.git
|
|
cd web2.0
|
|
```
|
|
|
|
Change to the development branch:
|
|
|
|
```
|
|
git checkout develop
|
|
```
|
|
|
|
## Install Python3
|
|
|
|
Python version >3.5, pip and virtualenv are needed.
|
|
|
|
Install with apt:
|
|
```
|
|
sudo apt install python3
|
|
sudo apt install python3-pip
|
|
sudo pip install virtualenv
|
|
```
|
|
|
|
## Install PostgreSQL
|
|
|
|
Version >9.5 is needed. More info at:
|
|
https://www.postgresql.org/
|
|
|
|
Install with apt:
|
|
```
|
|
sudo apt install postgresql
|
|
```
|
|
|
|
## Install dependencies
|
|
|
|
The following packages *might* need to be installed depending on your system. Find the corresponding packages
|
|
from your distribution's repository.
|
|
|
|
* python3-dev
|
|
* libffi-dev
|
|
* python3-cffi
|
|
* libssl-dev
|
|
|
|
The packages shouldn't be needed on Ubuntu 16.04, which is the most tested platform.
|
|
|
|
Install them with apt:
|
|
|
|
```
|
|
sudo apt install python3-dev libffi-dev python3-cffi libssl-dev
|
|
```
|
|
|
|
|
|
## Create a virtual environment for python
|
|
|
|
Create a virtualenv in the parent directory.
|
|
```
|
|
virtualenv -p python3 ../virtualenv.sikweb
|
|
```
|
|
|
|
## Activate virtualenv
|
|
|
|
Assuming we are at the root of this repository and virtualenv is one level above.
|
|
|
|
```
|
|
. ../virtualenv.sikweb/bin/activate
|
|
```
|
|
|
|
## Run install wizard
|
|
|
|
Run the install wizard with
|
|
|
|
```
|
|
sh setup.sh
|
|
```
|
|
|
|
and follow the instructions.
|
|
|
|
## Running
|
|
|
|
### Use runserver command
|
|
|
|
```
|
|
python manage.py runserver 0.0.0.0:8000
|
|
```
|
|
|
|
Using address 0.0.0.0 will bind all IP addresses.
|
|
|
|
### Visit the page
|
|
|
|
Visit https://localhost:8000 in your browser!
|
|
|
|
### Run unit tests
|
|
|
|
```
|
|
python manage.py test -v 2
|
|
```
|