![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-spaceless-templates
Advanced tools
Django application, providing simple template loader. It reduces HTML output in templates by stripping out whitespace
characters between HTML and django template tags. With cached template loader, whitespace stripping is done only once
during template compilation. This is more efficient than solutions based on {% spaceless %}
tag or middleware minification.
This package is based on following unmaintained packages:
Django template minifying loader <https://github.com/SectorLabs/django-template-minifying-loader>
_Django template minified <https://github.com/iRynek/django-template-minifier>
_How much bandwidth does it save? Check data from real project:
================ ======== ================= Normal HTML 109kB 15kB gzipped Spaceless HTML 67kB 13kB gzipped Saved 38 % 12 % gzipped ================ ======== =================
.. code-block:: bash
pip install django-spaceless-templates
Modify Your Django project settings's module.
For production (note cached loader):
.. code-block:: python
TEMPLATES = [ { 'DIRS': [ str(APPS_DIR.path('templates')), ], 'OPTIONS': { 'loaders': [ ( 'django.template.loaders.cached.Loader', [ 'django_spaceless_templates.loaders.filesystem.Loader', 'django_spaceless_templates.loaders.app_directories.Loader', ], ), ], }, }, ]
For development (each refresh reloads template):
.. code-block:: python
TEMPLATES = [ { 'DIRS': [ str(APPS_DIR.path('templates')), ], 'OPTIONS': { 'loaders': [ 'django_spaceless_templates.loaders.filesystem.Loader', 'django_spaceless_templates.loaders.app_directories.Loader', ], }, }, ]
Using modified settings You can:
.. code-block:: python
TEMPLATE_MINIFIER_FILENAME_EXTENSIONS = ('.html', '.htm', )
.. code-block:: python
TEMPLATE_MINIFIER_EXCLUDED_DIRS = ('admin/', )
.. code-block:: python
TEMPLATE_MINIFIER = False # default = True
.. code-block:: python
TEMPLATE_MINIFIER_STRIP_FUNCTION = 'template_minifier.utils.strip_spaces_in_template'
.. code-block:: python
if DEBUG: TEMPLATE_MINIFIER = False
//
one line comments in your inline javascript <script>
tags. Use / / instead:.. code-block:: js
// comment something - !!it's evil!! and cause the rest of JS code is commented out. function name() { }
/* comment something - it's nice and clean <3! */ function name() { }
{% blockquote %}
without parameter trimmed <https://docs.djangoproject.com/en/2.1/topics/i18n/translation/#blocktrans-template-tag>
_.
Otherwise your blockquote translations won't be translated. Correct usage:.. code-block:: python
{% blockquote trimmed %}
My paragraph...
{% blockquote %}
{{ " " }}
:.. code-block:: html
<div>Text {{ " " }} {{ variable }}</div>
::
(myenv) $ pip install -e .
(myenv) $ python ./runtests.py
.. code-block:: bash
python -m build; python -m twine check dist/*
FAQs
Simple Django template loader that minifies html output.
We found that django-spaceless-templates 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.