kolibri
kolibri copied to clipboard
Add instructions for running with postgresql locally (and production?) in dev docs
I don't think there are instructions on how to set up Kolibri to use Postgres as an alternative DB. Here's what @lyw07 shared with me on how to do it:
- Install postgresql (
brew install postgresql
if you have mac + homebrew) - install psycopg2-binary from pip (
pip install psycog2-binary
) - set env var
KOLIBRI_DATABASE_ENGINE
to postgres - set other env vars
KOLIBRI_DATABASE_NAME
,KOLIBRI_DATABASE_PASSWORD
,KOLIBRI_DATABASE_USER
,KOLIBRI_DATABASE_HOST
, andKOLIBRI_DATABASE_PORT
Example .env
file
KOLIBRI_DATABASE_ENGINE = postgres
KOLIBRI_DATABASE_NAME = postgres
KOLIBRI_DATABASE_PASSWORD = postgres
KOLIBRI_DATABASE_USER = [shell username]
KOLIBRI_DATABASE_HOST = 127.0.0.1
KOLIBRI_DATABASE_PORT = 5432
May also need to delete ~/.kolibri/.data_version
if already started server with sqlite.
Thanks, yes. This was discussed in the last dev meeting
@cpauya made a good initial start of instructions here: https://github.com/learningequality/kolibri/issues/6480#issuecomment-583299221
- We should add instructions to create the initial database
-
pip install psycog2
should be instead ofpip install psycog2-binary
- the user credentials and database name will depend on your postgresql instalation (and location, if it is in another server)
I think Lingyi used psycog2-binary
for a specific reason I can't remember. Is using psycog2
something we should do because of a recent change?
There are more details on how to make the initial database table in this comment: https://github.com/learningequality/kolibri/issues/6480#issuecomment-583299221
I think a script file that someone could pipe into the postgres interpreter would be convenient.
I think Lingyi used
psycog2-binary
for a specific reason I can't remember. Is usingpsycog2
something we should do because of a recent change?
lol
I used psycopg2
because I could not find in psycog2-binary
in pip. The reason was I copied and pasted from your comment and there's a missing p
in the package name. If you fix it, it's fine as installing the binary avoids the compilation phase in pip
This PR by @bjester https://github.com/learningequality/kolibri/pull/9556 added some make commands to make this easier, but instructions would finalize this issue!