Browse tags
  • 🔗 Building Search DSLs with Django

    Search DSLs can give a user more granular access to searching without exposing an overly complicated interface.

    GitHub issues provide a DSL that’s accompanied by UI elements. An example query for searching issues would be:

    is:open author:danlamanna

    We can create something similar for use in a custom Django application.
    Improving search on my website has been long on my list of things to do. Something like this would make it easy for me to search my posts like "city:Yokohama type:checkin" to find all checkins in Yokohama. 🤔
  • 🔗 Django & Celery in production

    DjangoCon JP 2021 発表資料

    Djangoで非同期処理を実現するために、よく使われているCelery。ただDjangoほど知見が共有されていないため、なんとなく使っているという方も多いのではないかと思います。そのような場合Celeryを使えるようにするまでは順調でも、実際に運用がはじまったあとに困ることが出てきます。例えば、ログの保存、リトライの設計、デプロイ戦略など。
    このトークでは、CeleryをDjangoプロジェクトで実際に運用するうえでの役立つTipsをお伝えします。
    Some good tips about Celery Production tips from Django Congress 2021 in Nagano this year (I couldn't attend). Most of the information is in the docs in English, but it's handy to see it condensed, even if it's in Japanese. A couple key points:

    • Use **kwargs for your tasks input. This makes it easier to make updates to your tasks once they're already running in production if your input needs to change. 
    • Reminders about all of the handy kwargs you can pass to tasks in regards to retry. Especially handy autoretry_for where you can pass a tuple of exceptions that will cause the task to automatically retry