Base application for management of employees working hours
- Python 3.7.0
- Django 2.1.1
Clone following repository:
git clone https://github.com/Code-Poets/sheetstorm.git
NOTE: Upon completing all steps for required OS, please refer to the local configuration sub-section.
-
Install Python 3.7.0 by running in terminal
sudo apt install python3.7
You can verify the installation by running:
python3.7 --version
-
Install PIP:
sudo apt install python3-pip
You can verify the installation by running:
python3.7 -m pip
. -
Install pipenv with PIP:
pip install pipenv
Remark: pipenv 11.9 does not work, if you encounter a release problem try 2020.8.13
-
Change directory to the folder containing SheetStorm project, activate virtual environment and install all dependencies from Pipfile:
pipenv shell pipenv install
Remark: if not all dependaencies are installed try
pipenv install --dev
. -
Install PostgreSQL:
sudo apt install postgresql postgresql-contrib
-
With administrative rights, edit file located in /etc/postgresql/<version>/main/pg_hba.conf. Change <method> to trust in the following line:
local all postgres <method>
Restart PostgreSQL:
sudo service postgresql restart
-
Create database for application:
createdb -U postgres sheetstorm
-
Install Xcode command-line tools by running
xcode-select --install
in terminal. -
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Install Python 3.7.0:
brew install python
You can verify the installation by running
python3 --version
. -
Install PIP:
sudo easy_install pip
You can verify the installation by running:
pip3 --version
. -
Install virtualenv with PIP:
pip3 install virtualenv
-
Create new virtualenv and install all dependencies:
virtualenv ~/.virtualenvs/sheetstorm --python python3.7 source ~/.virtualenvs/sheetstorm/bin/activate pip install pip --upgrade # Dependencies for running sheetstorm application pip install --requirement sheetstorm/requirements.lock
-
Install PostgreSQL with
brew install postgresql
.Create a database cluster:
initdb /usr/local/var/postgres
-
With administrative rights, edit file located in /usr/local/var/postgres/pg_hba.conf. Change <method> to trust in the following line:
local all postgres <method>
Restart PostgreSQL:
brew services restart postgresql
If server is unavailable, even though homebrew claims that service is running, try manual restart with:
pg_ctl -D /usr/local/var/postgres restart
-
Create database for application:
createdb -U postgres sheetstorm
-
Install Python 3.7.0 with web-based installer.
You can verify Python installation by running
python --version
in Command Prompt.You can verify PIP installation by running
pip --version
. -
Install virtualenv with PIP:
pip3 install virtualenv
-
Create new virtualenv and install all dependencies:
virtualenv ~/.virtualenvs/sheetstorm --python python3.7 <your venv location>\Scripts\activate pip install pip --upgrade # Dependencies for running sheetstorm application pip install --requirement sheetstorm/requirements.lock
-
Install BigSQL PGC and PostgreSQL 10.5:
cd C:\ #Install BigSQL PGC @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://s3.amazonaws.com/pgcentral/install.ps1'))" #Install PostgreSQL cd bigsql pgc install pg10
-
Edit file located in C:\bigsql\pg10\init\pg_hba.conf, add the following line to file:
local all postgres trust
Restart PostgreSQL:
C:\bigsql\pgc restart pg10
-
Create database for application by running the following command in Command Prompt:
C:\bigsql\pg10\bin\createdb -U postgres sheetstorm.
Create your local configuration in /sheetstorm/settings/local_settings.py
from .development import *
If your database configuration differs from the defaults, you may need to tweak the values below and add them to your local_settings.py too:
DATABASES['default']['NAME'] = 'sheetstorm'
DATABASES['default']['USER'] = 'postgres'
DATABASES['default']['PASSWORD'] = ''
This project uses Selenium framework for simulating client behaviour for testing purposes.
In order to successfully run edge-to-edge tests, Chrome browser must be installed
and ChromeDriver must be downloaded and included in PATH.
You can run edge-to-edge tests by executing script located in e2e.sh
file.
NOTE: Chrome supports headless run. In order to run tests in headless mode, modify following value in sheetstorm/settings/testing.py
:
HEADLESS_BROWSER_RUN = False #Change to 'True' for headless testing run