diff --git a/INSTALL.md b/INSTALL.md index 492e4bc8..8403d8b9 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,35 +1,48 @@ -# HOWTO install/test Open Prices API +# HOW TO install Open Prices API ## Prerequisites -- Python 3.11 (lower version may be OK, but untested) -- PostgreSQL 13 (lower version may be OK, but untested) +* Python 3.11 (lower version may be OK, but untested) +* PostgreSQL 13 (lower version may be OK, but untested) ## Setup -### Without Docker - ``` -# clone repo +# Clone repo git clone https://github.com/openfoodfacts/open-prices.git cd open-prices -# install poetry (Python dependency manager) at version 1.6.1 +# Copy .env.example to .env + +``` + +### Without Docker + +``` +# Install poetry (Python dependency manager) # see https://python-poetry.org/docs/ -# install dependencies (pyproject.toml) +# Install dependencies (pyproject.toml) poetry install -# note: all future commands should be prefixed with `poetry run` +# Note: all future commands should be prefixed with `poetry run` + +# Apply migrations +python manage.py migrate + +# Run Locally +python manage.py runserver -# run migrations -alembic upgrade head +# Now the server will run on http://127.0.0.1:8000 ! + +# Note: you can change the port if you want +python manage.py runserver 8001 ``` ### With Docker -:::info -Open Prices now only supports docker compose v2 (`docker compose`) +::: Info +Open Prices now only supports docker compose v2 ( `docker compose` ) ::: create the dockers with @@ -38,7 +51,7 @@ create the dockers with docker compose up ``` -The sever should be running on . +The sever should be running on . The run the migration of the database with @@ -47,15 +60,3 @@ make migrate-db ``` Congrats, you can now contribute to the codebase :tada: - -## Run locally - -``` -uvicorn app.api:app --reload -``` - -or use `--host` if you want to make it available on your local network, eg.: - -``` -uvicorn app.api:app --reload --host 192.168.0.100 -``` diff --git a/README.md b/README.md index 896d196b..9fcfb11d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ A REST API designed to interact with the Open Food Facts _Open Prices_ database. ## Dependencies * Python 3.11 -* [FastAPI](https://fastapi.tiangolo.com/) framework +* [Django](https://www.djangoproject.com/) framework * PostgreSQL database ## How to install on your local machine diff --git a/docs/README.md b/docs/README.md index 03bf911a..270f6bf1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,7 +4,7 @@ Open Prices is a project to collect and share prices of food products around the It consists of: -- a REST API, built using FastAPI (repo: [`open-prices`](https://github.com/openfoodfacts/open-prices)) +- a REST API, built using Django (repo: [`open-prices`](https://github.com/openfoodfacts/open-prices)) - a [web interface](https://prices.openfoodfacts.org/app/), built using Vue.js (repo: [`open-prices-frontend`](https://github.com/openfoodfacts/open-prices-frontend)) If you're a contributor, have a look at our tutorials to add a [single](add-a-price.md) or [multiple](add-multiple-prices.md) prices!