ShadCN Implementation
This commit is contained in:
10
backend/.env.example
Normal file
10
backend/.env.example
Normal file
@@ -0,0 +1,10 @@
|
||||
DJANGO_SECRET_KEY=change-me
|
||||
DJANGO_DEBUG=1
|
||||
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
|
||||
DJANGO_TIME_ZONE=Europe/Budapest
|
||||
DJANGO_CSRF_TRUSTED_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
|
||||
DJANGO_CORS_ALLOWED_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
|
||||
|
||||
# Optional overrides. The defaults already point at ../data/legacy/.
|
||||
# LEGACY_CINCIN_DB=/absolute/path/to/cincin_phase1.sqlite
|
||||
# LEGACY_DALCORSO_DB=/absolute/path/to/dalcorso.sqlite
|
||||
@@ -14,14 +14,24 @@ This is the replacement backend for the legacy FastAPI app.
|
||||
|
||||
## Expected setup
|
||||
|
||||
1. Install dependencies from [`pyproject.toml`](/home/sandy/HUB-master/django-port/backend/pyproject.toml).
|
||||
2. Run `python manage.py makemigrations`.
|
||||
3. Run `python manage.py migrate`.
|
||||
4. Run `python manage.py createsuperuser`.
|
||||
5. Run `python manage.py import_legacy_data`.
|
||||
1. Create a virtualenv in `backend/`.
|
||||
2. Install dependencies from [`pyproject.toml`](pyproject.toml) with `pip install -e .`.
|
||||
3. Copy [`backend/.env.example`](.env.example) to `.env` or export the same variables in your shell.
|
||||
4. Run `python manage.py migrate`.
|
||||
5. Run `python manage.py createsuperuser` if you are starting from a blank DB.
|
||||
6. Run `python manage.py import_legacy_data` if you want to rebuild from the bundled legacy sources instead of using the committed `db.sqlite3`.
|
||||
|
||||
The import command now defaults to the bundled databases inside:
|
||||
|
||||
- [`../data/legacy/cincin_phase1.sqlite`](../data/legacy/cincin_phase1.sqlite)
|
||||
- [`../data/legacy/dalcorso.sqlite`](../data/legacy/dalcorso.sqlite)
|
||||
|
||||
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-port` subtree without depending on workspace-root data files.
|
||||
- The committed `db.sqlite3` is optional but supported. Keep it in the repo if you want seeded data to travel with the project.
|
||||
|
||||
@@ -110,5 +110,6 @@ CORS_ALLOWED_ORIGINS = [
|
||||
)
|
||||
]
|
||||
|
||||
LEGACY_CINCIN_DB = Path(os.getenv("LEGACY_CINCIN_DB", BASE_DIR.parent.parent / "cincin_phase1.sqlite"))
|
||||
LEGACY_DALCORSO_DB = Path(os.getenv("LEGACY_DALCORSO_DB", BASE_DIR.parent.parent / "dalcorso.sqlite"))
|
||||
LEGACY_DATA_DIR = BASE_DIR.parent / "data" / "legacy"
|
||||
LEGACY_CINCIN_DB = Path(os.getenv("LEGACY_CINCIN_DB", LEGACY_DATA_DIR / "cincin_phase1.sqlite"))
|
||||
LEGACY_DALCORSO_DB = Path(os.getenv("LEGACY_DALCORSO_DB", LEGACY_DATA_DIR / "dalcorso.sqlite"))
|
||||
|
||||
BIN
backend/db.sqlite3
Normal file
BIN
backend/db.sqlite3
Normal file
Binary file not shown.
Reference in New Issue
Block a user