![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
################## django-mathfilters ##################
.. image:: https://github.com/dbrgn/django-mathfilters/workflows/CI/badge.svg :alt: Build status :target: https://github.com/dbrgn/django-mathfilters/actions?query=branch%3Amaster
.. image:: https://pypip.in/d/django-mathfilters/badge.png :alt: PyPI download stats :target: https://crate.io/packages/django-mathfilters
django-mathfilters is a Python 3 module that provides different simple math filters for Django.
Django provides an add
template filter, but no corresponding subtracting,
multiplying or dividing filters.
Django ticket #361 <https://code.djangoproject.com/ticket/361>
_ has been
closed as wontfix, so I had to create an alternative that is easy to install
in a new Django project.
It currently supports int
, float
and Decimal
types, or any other
type that can be converted to int or float.
::
$ pip install django-mathfilters
Then add mathfilters
to your INSTALLED_APPS
.
You need to load mathfilters
at the top of your template. The script
provides the following filters:
sub
– subtractionmul
– multiplicationdiv
– divisionintdiv
– integer (floor) divisionabs
– absolute valuemod
– moduloaddition
– replacement for the add
filter with support for float /
decimal typesExample:
.. sourcecode:: html
{% load mathfilters %}
...
<h1>Basic math filters</h1>
<ul>
<li>8 + 3 = {{ 8|add:3 }}</li>
<li>13 - 17 = {{ 13|sub:17 }}</li>
{% with answer=42 %}
<li>42 * 0.5 = {{ answer|mul:0.5 }}</li>
{% endwith %}
{% with numerator=12 denominator=3 %}
<li>12 / 3 = {{ numerator|div:denominator }}</li>
{% endwith %}
<li>|-13| = {{ -13|abs }}</li>
</ul>
This module officially supports Python 3.5+ as well as PyPy3. Support for Python 3.3 and 3.4 is provided on best-effort basis, but there are no CI tests for it.
Supported Django versions are 1.11+, 2.x and 3.x.
MIT License <http://www.tldrlegal.com/license/mit-license>
_, see LICENSE file.
FAQs
A set of simple math filters for Django
We found that django-mathfilters demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.