django-compressor

Django-compressor and template tags in Django

孤街浪徒 提交于 2019-12-24 14:04:22
问题 Recently I have tried Django-Compressor. It's awesome and i like it too much, but i am having some troubles with offline compression ( COMPRESS_OFFLINE = True ) and template tags. I have {{ django_vars }} and {% django_tags %} inside my JS code and i guess Google Clousure compiler (the filter what i'm using with Django-Compressor) doesn't know to identify them. In fact, I think Django template structures like {% if something %} are deleted. How can i do to keep all this template vars/tags in

AWS S3 Url changing dynamically with django statics

老子叫甜甜 提交于 2019-12-24 10:45:06
问题 When I am serving static files from AWS S3 using the {%static %} template I get this type of url: https://elasticbeanstalk-eu-west-1-2548513.s3.amazonaws.com/css/7aa4edf0c543.css?Signature=lpSpJuyv55JwkjxGKnNVmfn5QKs%3D&Expires=1370880855&AWSAccessKeyId=AKIAIDOQ45S6OQCXGNYQ Well the signature changes everytime. So when I am using django_storages with offline compression the key for that file is changing everytime because its name is changing so I get the error: You have offline compression

Django Compressor with dynamic LESS file raises a FilterError(err)

醉酒当歌 提交于 2019-12-24 07:17:34
问题 I had to come up with quite a complicated setup to enable database based styling options for users. Users enter styles (like background color, font face, etc...) in the django admin backend. I am creating a dynamic LESS file by rendering a template view as plain text view like so: views.py: class PlainTextView(TemplateView): """ Write customized settings into a special less file to overwrite the standard styling """ template_name = 'custom_stylesheet.txt' def get_context_data(self, **kwargs):

Django-Compressor throws UncompressableFileError with django-storages using amazonaws and heroku

让人想犯罪 __ 提交于 2019-12-23 04:14:08
问题 I am having problem to locate the issue of the problem. I have settings folder and inside I have local.py, common.py and production.py. All is working great and it is compressing on localhost, but not on heroku. When I deploy it I am getting error: Internal Server Error: / UncompressableFileError at / 'https://xxxxx.s3.amazonaws.com/static/css/stylesheet.css' isn't accessible via COMPRESS_URL ('//xxxxx.s3.amazonaws.com/static/') and can't be compressed common.py # STATIC FILE CONFIGURATION #

Whitenoise and django-compressor cause 404 for compressed files

霸气de小男生 提交于 2019-12-21 21:37:17
问题 Trying to deploy a Django application to Heroku using whitenoise and django-compressor . Deploying it to production with DEBUG = False and COMPRESS_ENABLED = True , all my static assets can be accessed without a problem. However, all the compressed files return a 404, e.g.: http://*.herokuapp.com/static/CACHE/css/fbfaa35dc638.css Failed to load resource: the server responded with a status of 404 (NOT FOUND) Either enabling DEBUG or disabling COMPRESS_ENABLED fixes the problem, but of course

What should my LESS @import path be?

旧时模样 提交于 2019-12-21 08:49:07
问题 Here's the scenario: I'm running Django 1.3.1, utilizing staticfiles, and django-compressor (latest stable) to, among other things, compile LESS files. I have an "assets" directory that's hooked into staticfiles with STATICFILES_DIRS (for project-wide static resources). In that directory I have a "css" directory and in that a "lib.less" file that contains LESS variables and mixins. So the physical path is <project_root>/assets/css/lib.less and it's served at /static/css/lib.less . In one of

Django - The process cannot access the file because it is being used by another process

倾然丶 夕夏残阳落幕 提交于 2019-12-13 00:06:21
问题 I'm trying to run Django on my Windows 10, I'm sort of newbie on Django, I'm using Compressor Toolkit, my problem is, I can run the manage.py but the localhost says base.html, error at line 9 The process cannot access the file because it is being used by another process. <!DOCTYPE html> {% load compress %} {% load staticfiles %} <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, inital-scale=1"/> <title>{% block head_title %} Hydroqua Indonesia {% endblock

d3js returning “[object%20Object]” and “Uncaught TypeError: Cannot read property: nodes of undefined”

余生颓废 提交于 2019-12-12 16:22:33
问题 I am new to Javascript and Django. I have to animate a svg file with D3js, so to practice and understand how it works I decided to add the miserables widget to my local Django website. I have a simple view: def miserable(request): return render_to_response('index.html') The url is: url(r'^moremiser/$','more_miserable') and I copied both index.html and miserable.json into my template folder. When I go to the url that is supposed to display the widget all I get is a blank screen. what am I

Weird deployment issue with Django and CoffeeScript to Heroku

删除回忆录丶 提交于 2019-12-12 12:15:20
问题 This is sort of a complex question so it will take a bit to explain. I'm not looking for a direct answer so any advice would be good. I have a Django app that uses a lot of CoffeeScript. To compile the CoffeeScript in the project I am using the app django-compressor . To use django-compressor I need to install nmp (node package manager). Unfortunately, I can't install npm on Heroku. Thus, I need to compile the CoffeeScript before it hits the Heroku servers. So I did that by setting up Fabric

Gulp CSS minify & gzip + django-compressor not working

我只是一个虾纸丫 提交于 2019-12-11 02:02:46
问题 I am trying to minify and compress my css (and later js) and serve it. To this end I first minify and compress it with gulp and then serve the gzipped files with django-compressor (so only http request will be made). I pretty much followed this guide: http://www.revsys.com/blog/2014/oct/21/ultimate-front-end-development-setup/ Using directly the gzipped files works good, however when I try to group them with django-compressor I get the following error: UncompressableFileError at /