News for hackers. Stuff that matters.
Re:Django REST framework: 3.15.0 Release (Django 5.0 support) by raverbashing on Sunday March 17, 2024 @06:33AM (#39733365)
You can just do this with Flask or other frameworks/servers that support auto-restart

(yes I think some js frameworks also allow this)

Re:Django REST framework: 3.15.0 Release (Django 5.0 support) by JonathanBeuys on Sunday March 17, 2024 @06:40AM (#39733403)
When a framework "supports auto-restart", that usually means it has its own webserver for development and the auto-restart is supported when you use that.

I don't like having a different webserver in development and production.

Re:Django REST framework: 3.15.0 Release (Django 5.0 support) by loloquwowndueo on Sunday March 17, 2024 @10:31AM (#39734725)
For Python, gunicorn is suitable for production and development use and has a --reload option to reload on changed files. This functionality is framework-independent.
Re:Django REST framework: 3.15.0 Release (Django 5.0 support) by JonathanBeuys on Sunday March 17, 2024 @12:02PM (#39735357)
The way I understand the gunicord documentation, this has the same effect as if you set up a script which listens for file changes and restarts the server (or workers) every time a file changes.

That's way less efficient compare to how PHP handles it.

I don't want processes to be killed and new ones to be started every time I change a file.

PHP does it the right way: Only when a request that touches outdated code hits the server is that outdated code reparsed. As long as you just edit files, it uses up no resources at all.

Re:Django REST framework: 3.15.0 Release (Django 5.0 support) by loloquwowndueo on Sunday March 17, 2024 @01:38PM (#39736257)
I’ve never switched to the browser and reloaded the page fast enough to “beat” a gunicorn reload after editing a file. So I get not “wanting” a process restart but I don’t get why it’s such a big deal in a practical sense.

But hey if using what you use does what you want, then you do you.