Skip to content

Installation

bartmika edited this page Jan 15, 2019 · 3 revisions
  1. Clone the project.
git clone https://github.com/mikasoftware/mikaid.git
  1. Setup the virtual environment.
virtualenv -p python3.6 env;
source env/bin/activate;
  1. Install the Python dependencies.
pip install -r requirements.txt
  1. Open up yourpostgres command console and run the following commands:
drop database mikaid_db;
create database mikaid_db;
\c mikaid_db;
CREATE USER django WITH PASSWORD '123password';
GRANT ALL PRIVILEGES ON DATABASE mikaid_db to django;
ALTER USER django CREATEDB;
ALTER ROLE django SUPERUSER;
CREATE EXTENSION postgis;
  1. Populate the environment variables for our project.
./setup_credentials.sh
  1. Go inside the environment variables.
vi ./uservault/uservault/.env
  1. Edit the file to suite your needs.

  2. In your console, go ahead and initialize the project with your own values.

python manage.py migrate
  1. Confirm the project loads up.
python manage.py runserver 127.0.0.1:8000
  1. If you run http://127.0.0.1:8000 in your browser then you should see a page.

  2. The final two steps are to create an administrator account and setup an oAuth 2.0 application to be used. Start by creating an administrator user account.

python manage.py create_admin_user "bart@mikasoftware.com" "123password" "Bart" "Mika";
  1. Next create a password grant application which will be used for our web-application. It is important that you associate the admin user account with this password authorization.
python manage.py setup_resource_server_authorization "bart@mikasoftware.com"
  1. Yyou should see something like this. This information will be used for all the micro-services / web-application that you are building:
Resource Server - Auth Type: password
Resource Server - Client ID: DH3JtqAJ9sHB5dNDe1EVkVptsfZRkkgshaoLnfmr
Resource Server - Client Secret: uS1cgnF2YxBl0RvxhdD3KLpI1dorTGqkUPEcxiAKAnZ2MZYuIMmOwoz0KVmJ15HCyKSMSaD19ZHxMTp0VerWhtsbWSR3gZeRnGJfthV37xK0bcdaunqZOkqcSrMXsxlr
Resource Server - Access Token: DNvWPIcCNZulYrx1zIBPTu8DEANYn9
  1. Update your .env file with the above information.
Clone this wiki locally