openfoodfacts / open-prices

An open database of prices 🧾💸💰🏷️🤑🍽️
https://prices.openfoodfacts.org
GNU Affero General Public License v3.0
43 stars 12 forks source link

Rewrite the app in Python Django :rocket: #355

Closed raphodn closed 3 months ago

raphodn commented 4 months ago

I've been thinking lately...

Why ?

Having a couple of years of experience in Python Django, but only a few months now with Python FastAPI, I'm struggling to develop the backend as fast and solid as I wish..

Advantages of moving from FastAPI to Django

Disadvantages

Extra info

raphodn commented 4 months ago

Todo

Questions

raphodn commented 4 months ago

Which folder architecture ?

Existing

Repo Config Apps api web deps README Choice
django tutorial mysite/mysite mysite/<apps>
MTES-MCT/envergo envergo/config envergo/envergo/<apps> envergo/requirements.txt envergo/README.md
MTES-MCT/aides-territoires aides-territoires/src/core aides-territoires/src/<apps> inside each app inside each app aides-territoires/Pipfile aides-territoires/README.md
quiz-anthropocene/admin-backend admin-backend/core admin-backend/<apps> admin-backend/api admin-backend/pyproject.toml admin-backend/README.md
betagouv/Aidants_Connect Aidants_Connect/aidants_connect Aidants_Connect/<apps> Aidants_Connect/api Aidants_Connect/www Aidants_Connect/pyproject.toml Aidants_Connect/README.md
gip-inclusion/le-marche le-marche/config le-marche/lemarche/<apps> le-marche/lemarche/api le-marche/lemarche/www le-marche/pyproject.toml le-marche/README.md looks good!
gip-inclusion/les-emplois les-emplois/config les-emplois/itou/<apps> les-emplois/itou/api les-emplois/itou/www les-emplois/pyproject.toml les-emplois/README.md looks good!
betagouv/ma-cantine ma-cantine/macantine ma-cantine/data (models, ...) ma-cantine/api ma-cantine/web ma-cantine/requirements.txt ma-cantine/README.md
raphodn/open-prices-poc open-prices-poc/config open-prices-poc/<apps> open-prices-poc/api open-prices-poc/www open-prices-poc/pyproject.toml open-prices-poc/README.md

Todo

(closest to le-marche & les-emplois)

open-prices/config
open-prices/open_prices/<apps>
open-prices/open_prices/api
open-prices/open_prices/www
open-prices/pyproject.toml
open-prices/README.md
raphodn commented 4 months ago

Which tool to manage crons ?

Need

Tools comparison

Name Pros Cons Stars Choice
django-crontab - simple - only manages crons
- no admin integration
~800
django-celery - Celery is famous - cannot use DB as broker (since v4.2 ?) --> need to install Redis dependency ~1500
django-q - manage tasks, cron...
- can use DB as broker
- admin integration
- not maintainted anymore !! ~1800
django-q2 - replaces django-q ~300 yes !
raphodn commented 3 months ago

@monsieurtanuki deployed in prod !

raphodn commented 3 months ago

created a discussion here with a quick todo of next/upcoming issues : https://github.com/openfoodfacts/open-prices/discussions/421