Developers Guide #
Local Testing #
This will run against a local test database without running background tasks to update batches etc.
You will need a PostgreSQL database.
Check that you are running Python 3.10 If not then either install it from your distro or from python.org
- Install poetry
- Configure poetry to use python3.10:
``poetry env use 3.10 poetry config virtualenvs.in-project true
- Run
poetry shell
in the root directory to enter the virtual environment - Run
poetry install
to install dependencies
Now to build the Vitejs/htmx frontend install node Specifically you will need Nodejs 16 or later
- In the front-end directory run
npm install
thennpm run build
Set some environment variables:
- First set the config
$ export DJANGO_SETTINGS_MODULE=mwmbl.settings_dev
- For the database set
$ export DATABASE_URL="postgres://yourusername:yourpassword@localhost/yourdbname"
Where you replace username, password and database name respectivley with your own credentials.
Note that you can also directly edit the config in mwmbl/setttings*.py
instead of the environment variables.
Finally:
- Run the migrations
python3 manage.py migrate
- To start the service run
python3 manage.py runserver
- Make a search request in chrome (or your favorite REST api tool):
> http://localhost:8000/search?s=Newton