Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
django-static-precompiler
Advanced tools
Django Static Precompiler provides template tags and filters to compile CoffeeScript, LiveScript, SASS / SCSS, LESS, Stylus, Babel and Handlebars. It works with both inline code and external files.
Documentation is available at https://django-static-precompiler.readthedocs.io.
pip install django-static-precompiler
{% load compile_static %}
{% load static %}
<script src="{% static "path/to/script.coffee"|compile %}"></script>
<link rel="stylesheet" href="{% static "path/to/styles1.less"|compile %}" />
<link rel="stylesheet" href="{% static "path/to/styles2.scss"|compile %}" />
>>> from static_precompiler.utils import compile_static
>>> compile_static("styles.scss")
"COMPILED/styles.css"
django-static-precompiler | Python | Django |
---|---|---|
2.2+ | 3.6+ | 2.0 - 4.1 |
2.1 | 3.6+ | 2.0 - 4.0 |
2.0 | 3.4+ | 1.9 - 3.2 |
1.7-1.8 | 2.7+ | 1.7 - 2.2 |
1.6 | 2.7+ | 1.7 - 1.11 |
1.5 | 2.7+ | 1.6 - 1.10 |
1.1-1.4 | 2.7+ | 1.6 - 1.9 |
1.0 | 2.7+ | 1.6 - 1.7 |
libsass
clean_css
option to LESS compilerurl(..)
not followed
directly by ;
setup.py
to add compatibility with Python 3.4 and below.COFFEESCRIPT_EXECUTABLE
,
SCSS_EXECUTABLE
, SCSS_USE_COMPASS
, LESS_EXECUTABLE
--ignore-dependencies
option to compilestatic
command--delete-stale-files
option to compilestatic
commandinclude_path
option to LESS compilerload_paths
option when doing inline compilation
with libsass
load_paths
setting in SCSS/SASS compilers.run_command
utility function to rely on process return
code rather than stderr to determine if compilation has finished
successfully. WARNING! Changes in run_command
are backward
incompatible. If you use this function in your custom compiler you
should update your code.--presets
option in Babel compiler. See babel-cli
[options <https://babeljs.io/docs/usage/options/>]{.title-ref} for
more information.precision
option to SASS / SCSS / LibSass compilers. Set it to
8 or more if you compile Bootstrap.output_style
option to SASS / SCSS / LibSass compilers.compilestatic
management command--global-var
option in LESS compilerplugins
parameter to Babel compilerload_paths
parameter to SASS/SCSS compilersmodules
parameter to Babel compilerpip install django-static-precompiler[watch]
compile
template filter{% compile %}
template tag{% coffeescript %}
{% inlinecoffeescript %}
{% sass %}
{% inlinesass %}
{% scss %}
{% inlinescss %}
{% less %}
{% inlineless %}
STATIC_PRECOMPILER_COMPILERS
setting.COFFEESCRIPT_EXECUTABLE
SCSS_EXECUTABLE
SCSS_USE_COMPASS
LESS_EXECUTABLE
-C
(--no-cache
) flag is removed from SASS/SCSS compilersSTATIC_PRECOMPILER_LIST_FILES
setting{% inlinecompile %}
template tag{% coffeescript %}
{% inlinecoffeescript %}
{% sass %}
{% inlinesass %}
{% scss %}
{% inlinescss %}
{% less %}
{% inlineless %}
compilestatic
works if watchdog
isn't
installed.compilestatic
management command (replaces
static_precompiler_watch
)STATIC_PRECOMPILER_DISABLE_AUTO_COMPILE
to settingsSTATIC_PRECOMPILER_CACHE_NAME
to settingsSTATIC_PRECOMPILER_PREPEND_STATIC_URL
to settings{% compile %}
template tag@import
statements. Fix the bug with URLs
containing commas.static_precompiler_watch
: watch for changes in all directories
handled by static finders, not only STATIC_ROOT
static_precompiler_watch
: add --no-initial-scan
optioncompile_static
and compile_static_lazy
utility functions.FAQs
Django template tags to compile all kinds of static files
We found that django-static-precompiler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.