Questions tagged [django-compressor]

Django Compressor is a pluggable django app that combines and compresses linked and inline Javascript or CSS in a Django templates into cacheable static files by using the compress template tag

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

Django Compressor: multiple errors when ran but working fine

I have installed django-compressor==2.4.1 on my Django==2.2.28 project. As on the documentation, I installed it by putting compressor in my INSTALLED_APPS and added 'compressor.finders....
Kodeeo's user avatar
  • 137
0 votes
0 answers
193 views

How to configure Django project + Tailwind CSS + django-compressor + MinIO

I have Django project which I configured for local development on my notebook and docker-compose for production use. I use Tailwind CSS + django-compressor and it works great locally but I don't ...
Max Maximum's user avatar
0 votes
0 answers
59 views

manage.py compress: error 'utf-8' codec can't decode byte 0xad

I did or tried, like here https://github.com/kottenator/django-compressor-toolkit and https://gist.github.com/brizandrew/685a588fbefbd64cd95ed9ec4db84848 But after the command python manage.py ...
gglin's user avatar
  • 1
0 votes
0 answers
52 views

django-compressor serves old version of CSS file eventhough newer version is available

I am hosting my Django application on a DigitalOcean droplet (Ubuntu 22.10 with Gunicorn and Nginx. When I run my app locally everything looks fine, but as soon as I deploy, it is trying to load the ...
Raphael's user avatar
  • 89
1 vote
0 answers
100 views

Enabling gzip compression for CSS and JS files with Django compressor on Heroku

I am currently working on a small Django project that is deployed on Heroku. In order to optimize the website's performance, I decided to use the django-compressor package to merge and minify all the ...
Michael Ettlinger's user avatar
0 votes
1 answer
345 views

Django-compressor not finding blocks to compress in a GitHub Action

I have a Django project that's using django-compressor to minify and concatenate CSS files, using offline compression. I haven't yet put it on a server, but when I run manage.py compress in a GitHub ...
Phil Gyford's user avatar
  • 13.6k
0 votes
1 answer
158 views

Can I obfuscate CSS class names in Django?

I'm currently using "Django Compressor" to compress HTML, JS, and CSS files. These are the filters I use COMPRESS_FILTERS = { 'css': ['compressor.filters.yuglify.YUglifyCSSFilter'], ...
T H's user avatar
  • 443
0 votes
1 answer
415 views

ES6 bundled files approach in django

im stuck trying to work with a js library (ifc.js) inside my django project, I installed django-compressor and django-compressor-toolkit with default values, ifc.js uses rollup to bundle files, the ...
zevloo's user avatar
  • 109
2 votes
1 answer
335 views

Django-compressor has a JS cache folder that is using an absurd amount of space

I woke up this morning to alerts from sentry that my production server has completely run out of space. It took some time figuring out the cause via ncdu, and the results were that my static folder ...
user avatar
1 vote
1 answer
449 views

Django Compressor returns error when applied

I have been implementing this active search with htmx. I changed my settings after which my app couldn't work here is part of my settings COMPRESS_FILTERS = {'css': ['libman.admin.PostCSSFilter']} ...
fakeMake's user avatar
  • 718
0 votes
0 answers
318 views

Django compressor is not effective

I've successfully set everything in the setting.py and when running py manage.py compress it runs without errors and I see that 2 blocks have been compressed. Here is the template: {% compress css %} &...
vargaking's user avatar
1 vote
0 answers
264 views

Using an django-sass-processor library in django but refuses to apply the style because its MIME type is not a supported stylesheet

I'm using Sass for my Django(3.2.6) website with the help of libraries called django-compressor and django-sass-processor to compile it to a .css file. It works fine during development but when I try ...
Jaymark Marquez's user avatar
1 vote
0 answers
266 views

Compressed CSS files generated by django-compressor/libsass are not served on the first launch of the server, but are served on subsequent launches

I'm working on a Django app for the first time and I had reached a stage where I was feeling comfortable with the app's functioning in the development environment. To deploy I had to set DEBUG=False ...
Amos P's user avatar
  • 35
0 votes
1 answer
432 views

django-compressor writing new files in collect_static/CACHE on every request

I've a django website set up using django-compressor + memcached. Not sure when it started, but I'm finding new css and js files in .../collect_static/CACHE/css and .../collect_static/CACHE/js every ...
manisar's user avatar
  • 103
1 vote
0 answers
445 views

Django/SCSS: missing staticfiles manifest -> staticfiles.json with empty paths

EDIT 05/02/2021 10:45 I still do not find any solution to my issue reading other post show that there are many possible cause to this issue If someone could help and explain me how django_compressor ...
Mereva's user avatar
  • 360
2 votes
0 answers
301 views

How to obfuscate vue js code used in django template as inline script?

I am developing an app using django as backend, and django templates for front end (Pages reload when navigating between urls). For some advanced features, I had to use ajax communication between the ...
DevNir's user avatar
  • 21
2 votes
2 answers
485 views

Django-Compressor won't work in offline mode with custom S3 domain

I get the following error whenever a custom domain for the S3 endpoint is used. # WORKS AWS_S3_CUSTOM_DOMAIN = 'example.fra1.digitaloceanspaces.com/{}'.format(AWS_STORAGE_BUCKET_NAME) # DOES NOT ...
Carlos's user avatar
  • 5,405
0 votes
1 answer
201 views

remove comments of minified css/js in django compressor

I have django-compressor in my project and i use this filters for minify: 'css': [ 'compressor.filters.css_default.CssAbsoluteFilter', 'compressor.filters.cssmin.CSSMinFilter' ], 'js': [ ...
jynx maze's user avatar
0 votes
1 answer
1k views

How to solve an "OfflineGenerationError: You have offline compression enabled but key ..." served up by Windows 2019 IIS?

My code with django-compressor works on my local machine with DEBUG=True or False, but when I push to production, which is a Windows Server 2019 served by IIS, then it only works with DEBUG=True. If ...
Douglas T's user avatar
  • 191
1 vote
1 answer
304 views

django-compressor Uncaught SyntaxError: import declarations may only appear at top level of a module

This is my JS structure: This is the beginning index.js import { elements } from './views/base'; const state = {}; const controlRandomPhrasal = async () => {} My base.js: export const elements = {...
antonio's user avatar
  • 477
0 votes
0 answers
780 views

View your source map files produced using webpack

My application uses django on the backend and Vuejs on the frontend (doesn't use vue-cli). So the index.js from Vue is used something like this in my base.html {% compress js %} <script type=&...
Gagan Ganapathy Ajjikuttira's user avatar
0 votes
1 answer
497 views

Django compressor and Cloudfront

I use AWS S3 to store my Django static files (using django-storages). And alternate cloudfront domain name to serve these files. I am unable to finish Django compressor via python manage.py compress. ...
shawnngtq's user avatar
  • 697
3 votes
1 answer
778 views

Django + Sass + Compressor: loading cached css files, unable to update or remove

Aloha! I have been working on a django project and recently switched to SASS for styling. The initial compiling on the css file seemed to work fine, but once I went to update the file I noticed the ...
Zoneo's user avatar
  • 83
4 votes
2 answers
2k views

Django Whitenoise with compressed staticfiles

I'm not able to get my django project to run with whitenoise and compressed staticfiles (including libsass). In links below, I read that it's only possible by offline compression of needed staticfiles....
Henhuy's user avatar
  • 1,034
4 votes
1 answer
2k views

Django compressor does not uglify javascript

I wish to use Django Compressor to both minify and uglify my css and javascript. I have got it working such that I do an offline compression and all required javascript is compressed correctly. The ...
darkpool's user avatar
  • 14k
3 votes
1 answer
953 views

Compile SASS/SCSS files on Heroku in Django app

I am getting an error when DEBUG is set to False or unset in Heroku, in Django app, when I activate logs. ValueError: Missing staticfiles manifest entry for 'css/sass/home.css' Seems that my SCSS ...
ketimaBU's user avatar
  • 931
0 votes
1 answer
427 views

Use Django_compressor ES6Compiler under Windows

I tried to run a Django App I developed under Linux on an Windows setup. The Application starts, but when I enter a page with a template which uses the compressor like this ("index.js" imports npm ...
TheNewCivilian's user avatar
10 votes
2 answers
4k views

Django compress error: Invalid input of type: 'CacheKey'

We suddenly started getting this issue when compressing django static files on production servers. Ubuntu 16.04, Python 3.x, Django 1.11. I am using an ansible-playbook to deploy. The error is as ...
nael's user avatar
  • 1,449
7 votes
1 answer
4k views

OfflineGenerationError - Key not in Manifest Json

The Django Error: OfflineGenerationError at / You have offline compression enabled but key "e3efe8ea14c9eeeff843e0280b54e1d92c293a5018e6d4a0be93a65997d8e246" is missing from offline manifest. You ...
Philip Lee's user avatar
2 votes
0 answers
368 views

Django-compressor & S3 Boto: Static files not compressed

The Error The static files are saved in S3 - however they are not compressed. My Code HTML {% compress css %} <link href="{{ STATIC_URL }}css/project.css" rel="stylesheet" type="text/css" ...
Emile's user avatar
  • 3,474
0 votes
0 answers
60 views

Why is my Django loading raw css into my html files?

I have a Django project which has been set us using django-pipeline and django-compress. The code on github is pretty standard ex: {% extends "base.html" %} {% load static from staticfiles %} {% ...
salty_coffee's user avatar
0 votes
2 answers
146 views

Can I have Django template tags inside a django-compressor tag?

For example: {% compress css %} <link rel="stylesheet" href="{% static 'css/foo.css' %}"> {% if foobar %} <link rel="stylesheet" href="{% static 'css/bar.css' %}"> {% ...
Zilong Li's user avatar
  • 909
0 votes
1 answer
359 views

Django-compressor: Enable BrotliCompressorFileStorage with offline compression mode

I'm using offline compression in conjunction with whitenoise on heroku and everything works fine before I overrode COMPRESS_STORAGE to enable broli compression as below: INSTALLED_APPS += ['...
Zilong Li's user avatar
  • 909
0 votes
1 answer
126 views

is django compressor default on django install?

Is django compressor default on django install? I have been having an issue with whitenoise and django. I keep getting this error: ValueError: Missing staticfiles manifest entry for 'inline.bundle....
weridpotato's user avatar
1 vote
1 answer
2k views

django-compressor CommandError: An error occurred during rendering file/path.html: Invalid class path 'css'

I'm trying to use django-compressor for my project. So far in my development environment, when I run python manage.py compress I been get this error CommandError: An error occurred during rendering D:...
chidimo's user avatar
  • 2,740
7 votes
1 answer
688 views

Django 1.11.7 - Django Compressor - argument 5: <class 'TypeError'>: expected LP_OVERLAPPED instance instead of pointer to OVERLAPPED

I'm trying to get an existing Django 1.11.7 (Python 3.5) project up and running on my Windows 10 box. After getting my environment set up, I'm now seeing the home page after running the application, ...
Keith's user avatar
  • 5,321
0 votes
1 answer
313 views

Compressed jQuery File Causing Content Security Policy Error in Chrome

I have a hosted jquery file that I'm compressing using django compressor and serving via cloudflare. Compression looks like this: {% compress js %} <!-- JavaScript --> <script type=...
John Rogerson's user avatar
0 votes
2 answers
79 views

Ignore external sources being compressed in mezzanine

Tring to load external source in contact form template, mezzanine Example {% block extra_js %} {{ block.super }} <script src="https://www.google.com/recaptcha/api.js" async defer></...
demonno's user avatar
  • 524
2 votes
0 answers
146 views

Access Denied - CloudFront + Django Compressor

Just started using django compressor along with my AWS/Cloudfront setup on Heroku. Having an issue on my local machine where the compressed CSS and JS files are not loading for the page and when i ...
John Rogerson's user avatar
0 votes
1 answer
1k views

"sass.CompileError: Error: It's not clear which file to import" arising when using Django Compressor and Django Sass Processor

I'm trying to add the Materialize source to a Django project. In my stylesheets directory, I have the following structure: (venv) Kurts-MacBook-Pro-2:lucy kurtpeek$ tree lucy-web/lucy_web/static/...
Kurt Peek's user avatar
  • 53.2k
3 votes
1 answer
914 views

Have django-compressor leave <script type="module"> alone in non-production

For development (no DJANGO_PRODUCTION) I want to leave ES6 modules as-is, that means that if something is {% compress js %} <script src="{% static "path/to/some.js" %}" type="module"></...
phk's user avatar
  • 2,032
0 votes
0 answers
214 views

Offline context with Wagtail Page data (Django-Compressor)

I've got Wagtail set up with Django-Compressor (COMPRESS OFFLINE = True) which all works except for one template. This template uses the Disqus plugin which requires: An absolute page url A unique ...
DDiran's user avatar
  • 553
1 vote
1 answer
117 views

Making a Zurb Foundation theme for Mezzanine (django-compressor + SASS integration)

I'm building a bilingual site, which has both RTL and LRT content. Mezzanine comes with a twitter-bootstrap theme, which doesn't support RTL as well as zurb-foundation does. So I'm trying to create a ...
majdal's user avatar
  • 477
0 votes
1 answer
168 views

Django preventing the loading of django-compressor if DEBUG is True

I am using django-compressor with a remote site on an Ubuntu server. In my local environment, I'm on Windows, where django-compressor doesn't work. Therefore I can't load django-compressor in my ...
Newfoundland's user avatar
0 votes
1 answer
628 views

Django Compressor - COMPRESS_CSS_HASHING_METHOD not working

I would like to get the css file name unchanged after turning less file into css, and compression. All is managed by Django Compressor 2.1. The problem is that I get this kind of file name with a ...
emilie zawadzki's user avatar
1 vote
1 answer
1k views

Offline Generation Error - Django compressor

I am trying to setup Cabot via Flynn, which is basically like a in-house heroku. When I deploy eveything and try to run it, i get this exception. OfflineGenerationError: You have offline compression ...
Shaurya Chaudhuri's user avatar
1 vote
0 answers
177 views

Django compressor not converting images to data URIs

I'm having issues setting up replacing of URLs with data URIs with django compressor. Here are relevant settings: STATICFILES_FINDERS = [ 'django.contrib.staticfiles.finders.FileSystemFinder', ...
alh84001's user avatar
  • 1,273
0 votes
0 answers
358 views

django-compressor error after updating JS libraries to use npm

I had a set of JS static files being uploaded to S3 and compressed with django-compressor. django-compressor didn't give any issues during a deploy before. After I switched from JS files from living ...
nael's user avatar
  • 1,449
0 votes
1 answer
162 views

JS static files issues in AWS Production Django Application [duplicate]

I am having a weird issue where angular is undefined when application is deployed in AWS but locally there are no issues in my angular or javascript code. Update: My static files (JS, CSS, Images, ...
nael's user avatar
  • 1,449
0 votes
1 answer
882 views

Using django-compressor does not compress js

I can't for the life of me get compress js to work, compress css works fine. Rather than double post the entire thing, I've added a github issue here with all the details. https://github.com/django-...
vandekerkoff's user avatar