FarmDB is Climate Farmers internal database system for connecting farms, consultants, practices, modelled scenarios and metrics
-
First you need to clone the git repo.
-
You will need
python3
andpipenv
which is normally supplied by your operating system -
As we are using python 3.8 you might need to install pyenv if you are using a newer (or older) version. https://github.com/pyenv/pyenv
-
If you are planing on developing for farmdb you need to install all the packages with:
$ pipenv install --system --dev --ignore-pipfile
Don't forget to enable the env with:
$ pipenv shell
-
You will need to install postgis (https://wiki.openstreetmap.org/wiki/PostGIS/Installation) which is an extension of postgresql
-
Please edit the
bin/dev_setup.sh
file accordingly to your setupThen import it into your local shell
$ source bin/dev_setup.sh
-
Then you need to create the
farmdb
database withcreatedb farmdb
-
Now that you have all the DB setup you can migrate with
$ ./src/manage.py migrate
-
And you can finally run the server with
./src/manage.py runserver
You might want to create a user first with
./src/manage.py createsuperuser