Skip to content

Latest commit

 

History

History
53 lines (52 loc) · 2.37 KB

INSTALLATION.md

File metadata and controls

53 lines (52 loc) · 2.37 KB

Installation (Windows)

Get repository

  • cd %userprofile%/git/tasks_around_university
  • mkdir git
  • cd git
  • git clone https://github.com/JaliJuhola/tasks_around_university.git

Troubleshoot:

Install Python

Install python 3.7 globally

Install virtualenv and pip requirements

  • Start command prompt as adminstrator and py -m pip install virtualenv
  • cd %userprofile%/git/tasks_around_university
  • py -m virtualenv tasks_around_university
  • tasks_around_university\Scripts\activate
  • pip install -r requirements.txt

Instal node through node.js installation page

Install node package maanger dependecies

  • npm install -g expo-cli in root directory
  • npm install in git/tasks_around_university/tasks-around-university/android

Install and start postgres

migrate database

  • run python manage.py migrate in git/tasks_around_university/tasks-around-university

Start dev server and rest api

  • python manage.py runserver
  • expo start in git/tasks_around_university/tasks-around-university/android

Testing database connection

  • http://localhost:3000/mini_games/test
  • At the beginning database is empty clicking Post you create new database object and clicking patch you add item to it.
  • You can also observe this change in Django-shell by running python manage.py shell Example query:
from rest.hello_world.models import Counter
Counter.objects.count()
for item in Counter.objects.all():
    item.__dict__
// In example you can get dictionary for item showing in testing site by
// Counter.objects.last().__dict__
// Changing it by
// c = Counter.objects.last() 
// c.count = 9999
// c.save()
// now count in ui should be updated as well