django-walrus
django-walrus copied to clipboard
What do you get when you cross a pony and a walrus?
django-walrus

Installation
pip install django-walrus- Add
walrusto your settings'sINSTALLED_APPS - That's it. Now you can go for a swim in ice-cold water, or maybe hunt a penguin.
Usage
Once django-walrus is installed, you can use the power of the
walrus operator
in your template's {% if %} statements:
{% if result := my_mode.some_expensive_method %}
Wow, check out this result: {{ result }}.
{% else %}
Nothing to see here.
{% endif %}
Is this real?
As real as a two ton polar mammal.
Optimized
You can activate some optimizations by setting WALRUS_OPTIMIZED=1 in your shell
environment.