34 lines
993 B
Markdown
34 lines
993 B
Markdown
[Mardi 10 Février 2026]
|
|
|
|
# db Browser fir SQLite + fix grabber et serv local etc
|
|
django flask
|
|
1. [Commande du jour]
|
|
# uvicorn app:app --reload --host 0.0.0.0 --port 8000
|
|
|
|
The 500 Internal Server Error was caused by accessing ordi.hostname after the SQLAlchemy session was closed. Once session.close() is called, the Ordinateur instance becomes detached from the session, and accessing its attributes triggers a DetachedInstanceError because SQLAlchemy can't refresh the data.
|
|
|
|
I've moved the print statement to occur before session.close(), so the instance is still attached when accessing the attributes.
|
|
|
|
2. [Suite jsp]
|
|
ORM
|
|
Object Relationship Manager
|
|
|
|
------------
|
|
|
|
Interface utilisateur/api
|
|
-------------------------
|
|
ORM
|
|
-------------------------
|
|
SQL
|
|
|
|
app.py
|
|
(lancement de l'appli)
|
|
1/ Create_engine
|
|
2/ create_all
|
|
3/ create_session
|
|
4/ create_record
|
|
5/ session_commit
|
|
6/ session.close
|
|
|
|
grabber.sh -> /endpoint -> créer un ordi (-> qui est écrit dans la base de donnée)
|