Skip to content

Instantly share code, notes, and snippets.

@benjaminlong
benjaminlong / gunicorn.md
Created April 15, 2024 14:39 — forked from zpoint/gunicorn.md
difference bwtween gunicorn workers(sync/eventlet/gevent/thread/tornado)

gunicorn workersimage title

We've learned SyncWorker for gunicorn in part1, now let's see how other workers work

workers

contents

@benjaminlong
benjaminlong / foo.py
Created June 8, 2021 07:11 — forked from Grokzen/Symmetrical ManyToMany Filter Horizontal in Django Admin.py
Symmetrical ManyToMany Filter Horizontal in Django Admin
# Based on post from: https://snipt.net/chrisdpratt/symmetrical-manytomany-filter-horizontal-in-django-admin/#L-26
# Only reposting to avoid loosing it.
"""
When adding a many-to-many (m2m) relationship in Django, you can use a nice filter-style multiple select widget to manage entries. However, Django only lets you edit the m2m relationship this way on the forward model. The only built-in method in Django to edit the reverse relationship in the admin is through an InlineModelAdmin.
Below is an example of how to create a filtered multiple select for the reverse relationship, so that editing entries is as easy as in the forward direction.
"""
### pizza/models.py ###