Interaction between Python script and Django

Hello, I have the following project: I programmed a Python script with an infinite while loop on the Raspberry Pi. This script reads values ​​from the GPIO pins and processes them and outputs values ​​via GPIO pins (PID control). Now I would like to program a web interface via Django that always shows me the current GPIO values. It should also be possible to enter user values ​​via the web interface, which are then processed in the while loop. Has anyone of you already programmed something like this and can give me valuable tips on how best to implement it?

See the discussion at How to integrate GPIO input into django? for some ideas to get started.