Django Port
This is the replacement backend for the legacy FastAPI app.
Shape
config/: Django project settings and URL rootapps/accounts: users, roles, business access, device registrationapps/core: businesses, vendors, products, categoriesapps/operations: invoices, inventory, events, schedulesapps/reporting: dashboard-facing revenue aggregatesapps/notifications: reminders and inbox itemsapps/api: JSON endpoints for the Svelte frontend
Expected setup
- Create a virtualenv in
backend/. - Install dependencies from
pyproject.tomlwithpip install -e .. - Copy
backend/.env.exampleto.envor export the same variables in your shell. - Run
python manage.py migrate. - Run
python manage.py createsuperuserif you are starting from a blank DB. - Run
python manage.py import_legacy_dataif you want to rebuild from the bundled legacy sources instead of using the committeddb.sqlite3.
The import command now defaults to the bundled databases inside:
You can still override them with LEGACY_CINCIN_DB and LEGACY_DALCORSO_DB if needed.
Notes
- Auth uses Django sessions instead of custom JWT cookies.
- The import command consolidates both legacy SQLite files into one Django schema.
- Password hashes are not carried over directly; imported users get a forced reset placeholder.
- The backend is intended to be runnable from the
django-portsubtree without depending on workspace-root data files. - The committed
db.sqlite3is optional but supported. Keep it in the repo if you want seeded data to travel with the project.