andreyfedoseev / django-less Goto Github PK
View Code? Open in Web Editor NEWDjango template tags to generate CSS using LESS
License: Other
Django template tags to generate CSS using LESS
License: Other
I want to include an external less file. I followed the instructions from your README and the css file is created in the LESS_CACHE folder and visible in the filesystem, but the django development server replies with a 404 - Not Found
This is my project: https://github.com/schmittlauch/chorplaner/tree/less
I know that using non ascii characters in css iles is rare but it is allowed and I had to do just that, sadly it breaks
offending line is located in less/templatetags/less.py:
compiled_file = open(output_path, "w+")
compiled_file.write(URLConverter(out, os.path.join(STATIC_URL, path)).convert())
I don't know how to repair it though
the error reads:
'ascii' codec can't decode byte
css can be anything with non ascii, mine is
.external_link:first-child:before {
content:"Zobacz także:";
}
When there is an error inside of compiled *.less file (e.g. syntax or include error), no exception is raised. Instead path to uncompiled *.less file is returned by {% less %} tag.
Hi, is there any way to use django-less with other templates than the default ones? I'm using jade-lang with pyjade, and there is no {% load less %} so sompiling less is not posible. Or is it?
If there is not, maybe you could consider supporting other templating engines in some "general" way.
Thanks.
After LESS_MTIME_DELAY
, .less
files with @include "<FILE>"
do not register as needing to be recompiled if the imported file, but not the main file, has been changed.
Hello,
I am trying to use the template tag for a django application and while trying to setup my development environment on Mac OS X, the less tag is failing with:
[OS Error] No such file or directory
For my less file, which is on the directory i am indicating.
The issue is on line 47 of the less.py file.
I'm using Django 1.4.3 in development mode.
The structure of my project:
project/
manage.py
core/
settings.py
static/
less-cache/ <---- I want LESS cache to go here
admin/
less/
base.less <---- the file I want to compile
...
settings.py
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (
PROJECT_PATH + '/static/',
)
LESS_OUTPUT_DIR = 'core/static/less-cache/'
("core" is the name of my main application with settings.py).
If I do not specify LESS_OUTPUT_DIR, Django-Less generates LESS_CACHE in the root of my project (and not media root, as docs say...) so I have to point it to my actual static folder using LESS_OUTPUT_DIR.
The problem is:
<link rel="stylesheet" href="{{ STATIC_URL }}{% less "admin/less/base.less" %}" />
turns into
<link rel="stylesheet" href="/static/core/static/less-cache/admin/less/base-6792ecdf72ee.css" />
It gives 404, because in my case the URL should not contain the "core/static" part.
I'm not very experienced with static/media serving in Django (I just picked up those settings from one of the StackOverflow posts), but in my understanding if Django-Less offered a separate setting for URL path, I could easily solve my problem.
мне попался какой-то странный lessc, который выводил результат обратно в файл, эта ситуация никак не обрабатывается
I've got errors when I run django-less and django-coffeescript with python3 based django installation.
On Windows, my less files couldn't compile.
I found out that we must pass shell=True to subprocess to make it work properly on Windows.
(I explained it a bit here : http://stackoverflow.com/a/15617969/2198800)
The readme.rst contains the lines:
{% endless %}
For me it was throwing an error until corrected to {% endinlineless %}
I like the idea of your plugin. It is small and unobtrusive, exactly what I need. The only problem I experience is that lessc can not follow included less files like the ones which are coming with bootstrap.
at /var/lib/gems/1.8/gems/less-2.2.1/lib/less/js/lib/less/parser.js:390:69: 'bootstrap/bootstrap.less' wasn't found. (Less::ParseError)
from /var/lib/gems/1.8/gems/less-2.2.1/lib/less/parser.rb:57:in `to_css'
from /var/lib/gems/1.8/gems/less-2.2.1/lib/less/java_script/v8_context.rb:90:in `do_lock'
from /var/lib/gems/1.8/gems/less-2.2.1/lib/less/java_script/v8_context.rb:88:in `do_lock'
from /var/lib/gems/1.8/gems/less-2.2.1/lib/less/java_script/v8_context.rb:60:in `lock'
from /var/lib/gems/1.8/gems/less-2.2.1/lib/less/java_script/v8_context.rb:30:in `exec'
from /var/lib/gems/1.8/gems/less-2.2.1/lib/less/java_script.rb:26:in `exec' from /var/lib/gems/1.8/gems/less-2.2.1/lib/less/parser.rb:57:in `to_css'
from /var/lib/gems/1.8/gems/less-2.2.1/bin/lessc:23
from /usr/local/bin/lessc:19:in `load'
from /usr/local/bin/lessc:19
Is there an easy remedy for this problem?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.