-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
bartmika edited this page Jan 15, 2019
·
3 revisions
- Clone the project.
git clone https://github.com/mikasoftware/mikaid.git
- Setup the virtual environment.
virtualenv -p python3.6 env;
source env/bin/activate;
- Install the
Python
dependencies.
pip install -r requirements.txt
- Open up your
postgres
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;
- Populate the environment variables for our project.
./setup_credentials.sh
- Go inside the environment variables.
vi ./uservault/uservault/.env
-
Edit the file to suite your needs.
-
In your console, go ahead and initialize the project with your own values.
python manage.py migrate
- Confirm the project loads up.
python manage.py runserver 127.0.0.1:8000
-
If you run
http://127.0.0.1:8000
in your browser then you should see a page. -
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";
- 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"
- 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
- Update your
.env
file with the above information.