Hey there! I’m trying to install KA Lite (on macOS Sierra) following the instructions here but seem to be running into some issues.
I followed all of the instructions but found I also needed to do these two steps to get the pages to properly load:
$ npm install
$ kalite manage setup
Finally, running kalite manage runserver with the --settings=kalite.project.settings.dev flag then runs the server and everything loads!
However, I seem to be running into some performance issues with loading exercises. For example: loading one of the math pages like “Count with small numbers” takes a really long time. The page loads immediately but the actual exercise doesn’t show up for another 5-10 seconds. I don’t think I ran into these performance issues when I installed and ran KA Lite using the OSX dmg installer and starting the service from the app — are there app/project settings I can define to help increase performance, or am I missing any other installation steps?
Edit: Looks like the below is par for the course when running KA Lite in incognito mode. My guess is that the react code takes a while to compile/cache the front-end app, which it has to do on each page reload since incognito doesn’t cache anything. When I run this in a normal/non-incognito browser the first page load takes 6-10 seconds, and every subsequent reload is significantly faster (less than 1 second).
======
Some additional logging; looks like it takes about 7 seconds before the GET request to load the exercise kicks in:
We have some old documentation floating around, sorry about that. If you can point me to where you found these dev instructions, I can get them updated.
The best procedure is:
# make and enable a virtual env
# ...then install dependencies:
pip install -r requirements_dev.txt
# This compiles all necessary assets
make assets
# Setup database etc.
bin/kalite manage setup
Once initial has taken place, you can reuse this command, it rebuilds some JS assets at startup, so wait for this green status text to show up before loading it in the browser.
bin/kalite manage runserver --settings=kalite.project.settings.dev
For example: loading one of the math pages like “Count with small
numbers” takes a really long time. The page loads immediately but the
actual exercise doesn’t show up for another 5-10 seconds.
This exercise is really problematic. I’ve tried profiling it, with no luck - it seems to be very slow compared to other exercises on upstream KA.org - I tried it some months back. However, now it has completely vanished within the past month or so… maybe they’ve decided too that it was problematic. @richard or @radina-matic do you recall this particular exercise being buggy?
Hey Benjamin, thanks for the reply! The instructions I took were strictly from the docs on this page though I assumed I had to add in those additional commands myself (npm install and kalite manage setup) due to missing node packages and missing database table errors.
I’ll try playing with some other exercises now that I know the one I was playing with was explicitly problematic. I’ll follow up if there’s any further issues on my end, thanks again!
Looks like this should actually be bin/kalite manage setup which will then prompt you to setup the database.
After doing a clean installation using the steps you mentioned, looks like everything is running SIGNIFICANTLY faster. Thanks a ton for the help on this!