Hi Tim,
Sorry for such a late response, I was caught up in the midterms.
The project idea is like this:
Right now we have a Media class which is used to fetch the form assets but
is not very popular. In order to replace it with a new preprocessor, I see
two viable solutions:
1. Creating a new app 'static' in django.contrib with glean best practices
from django-pipeline and django-compressor.
In this option, all the assets need to be declared in STATIC_CSS and
STATIC_JS dicts in the settings for the different apps/scenarios just like
they have it in django-pipeline and these assets can be loaded in templates
as per requirements.
We can provide support for all the major js and css compressors/compilers
like CoffeeScript, LiveScript, Closure, JsMin, Slimit, UglifyJS and YUI
compressor for Javascript and CssMIN and CSSTidy minifier for CSS by
installing these compilers in advance.
All the files that need to be minified can be mentioned in source_filenames
and the minified version will be generated as STATIC_JS['output_filename']
after compilation during collectstatic.
For eg:
STATIC_JS = {
'main': {
'source_filenames': (
'coffee/app.coffee',
'js/*'
),
'output_filename': 'min.js',
},
}
STATIC_CSS = {
'main': {
'source_filenames': (
'stylus/main.styl',
'css/*',
),
'output_filename': 'main.css',
}
}
2. Creating a new 'Static' class in django.contrib.staticfiles and
integrating it with the current implementation to add preprocessing.
Another option is that, we can have a permanent solution without any future
need of any ad-hoc based solution for the problem of static resource
optimisation. But it will require a lot of changes in the entire structure
of staticfiles, mostly in staticfile handlers and storage. Placement of
compiler support files in contib.staticfiles might also be a concern in
this case.
I am still discovering and learning new things about django and
preprocessing. I'd really appreciate if I'll be able to get feedback on
this from django community, so that I can draft a better proposal for this
project.
Thanks
Varun
On Tue, Feb 24, 2015 at 5:00 PM, Tim Graham <[email protected]> wrote:
> Hi Varun,
>
> Thanks for your interest. If you want feedback, you'll need to describe
> your ideas in more detail.
>
> Tim
>
>
> On Monday, February 23, 2015 at 10:31:34 PM UTC-5, Varun Sharma wrote:
>>
>> Hi everyone,
>>
>> I've been pondering over the django codebase and GSoC ideas for some time
>> now. I find the idea of replacing Media class really interesting. As
>> mentioned in the ticket #22298
>> <https://code.djangoproject.com/ticket/22298> discussion, it will be
>> really usefull to replace the Media class with some sort of combination of
>> django-pipeline and django-compressor as a new Static class. I would love
>> to add this feature to django in this summer and I would like to discuss
>> this idea further to help me get the best implementation for this idea.
>>
>> Thanks
>> Varun
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/512d302f-bcb5-446c-afb6-a72dce93e7e6%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/512d302f-bcb5-446c-afb6-a72dce93e7e6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CAJ7sbhF%2BsOQNCTV4W7i6Mydsx%2B8zETKjtyvga%3DC5%3D9xtabMWwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.