- Install npm locally:
$ sudo apt-get update
$ sudo apt-get install nodejs
$ sudo apt-get install npm
Clone HappyKh project locally using git utility:
$ git clone https://github.com/Formeme/HappyKh.git
$ cd HappyKh
Create Python Virtual Environment with the name of venv in the root folder (you can use python3.6+) and apply it:
$ python3.6 -m venv venv
$ source venv/bin/activate
Configure Python Virtual Environment using file requirements.txt:
$ pip install -r happykh/requirements.txt
Run Django Development Server:
$ cd happykh
$ python3 manage.py runserver
- Click the Edit Configuration button and create new Django Server
- Add new Django Server using "+" button
- Add new Environment Variable (environment variables are separated by semicolon): DJANGO_SETTINGS_MODULE=happykh.settings
- Setup Python interpreter
- Click the Edit Configuration button and add Python test -> pytest
- Add new Environment Variable (environment variables are separated by semicolon):
- Setup Python interpreter DJANGO_SETTINGS_MODULE=happykh.settings
- Edit Working Direсtory input field
In HappyKh root folder go to the frontend folder:
$ cd frontend
$ npm install
After npm installation run command in order to launch the client server:
$ npm run serve
Install Postgresql db:
sudo apt-get install postgresql postgresql-contrib
Log into an interactive session:
sudo -u postgres psql
Create database and user localuser:
CREATE DATABASE happykh;
CREATE USER localadmin WITH PASSWORD 'localpassword';
Give your database user access rights to the database:
ALTER ROLE localadmin SET client_encoding TO 'utf8';
ALTER ROLE localadmin SET default_transaction_isolation TO 'read committed';
ALTER ROLE localadmin SET timezone TO 'UTC';
ALTER USER localadmin CREATEDB;
GRANT ALL PRIVILEGES ON DATABASE happykh TO localadmin;
\q
SENDGRID_API_KEY - WebAPI key is mandatory for sending email
EMAIL_HOST_USER - mailbox which will be used to send email from to other users
EMAIL_ENCODING_KEY - WebAPI key is mandatory for sending and changing an email
HASHID_FIELD_SALT - WebAPI key is mandatory for cyphering user id
DJANGO_SETTINGS_MODULE - the variable is mandatory for specifying Django settings
VUE_APP_GOOGLE_API - WebAPI key is mandatory for connecting to the Google API maps service