tedtieken / django-asset-convoy Goto Github PK
View Code? Open in Web Editor NEWA staticfiles post_processer / asset pipeline (fingerprint, minify, gzip) and concatenator for django 1.7+
License: Other
A staticfiles post_processer / asset pipeline (fingerprint, minify, gzip) and concatenator for django 1.7+
License: Other
For example, the key: base.css+++bootstrap.css
will continue serving the old version after base.css is updated.
Whereas, base.ba8d22dc55b9.css+++bootstrap.0dd5f89c8f8a.css
would reload if the base.css fingerprint changed from ba8d22dc55b9 to f6dbfb2de91b. The new cache key would be: base.f6dbfb2de91b.css+++bootstrap.0dd5f89c8f8a.css
which would get the new version of the assets
Edit readme for readability / conciseness. Move some documentation to wiki or other readmes
Currently, convoy fully processes every file every time collectstatic is run. This makes pushing small changes to heroku painful, unless collect static is turned off (heroku config:set DISABLE_COLLECTSTATIC=1
). Find a way to fix this.
The change that fixed django issue #22557, django/django@0007a43, makes it so a new OrderedDict
is created every time the ManifestFilesMixin
's post_process
method is called -- this has implications for what we need to override and what order we have to call up the chain.
Luckily, the proposal to split post_process
and save_manifest
into separate methods was eventually accepted, so we don't have to do a ton of repeat work to accommodate this change. :)
This also means we can remove the collectstatic monkey patch:
https://github.com/tedtieken/django-asset-convoy/blob/master/convoy/models.py#L8
We should test that rendering using convoytags works correctly in our tests. My test covers the basic file processing but it doesn't test the rendering layer.
Be able to install django-asset-convoy
via pip install -e /path/to/convoy
so that we can edit convoy while using it with a django project.
Not unit testing, but an end-to-end integration test.
@tedtieken provide fix pulz
Environment:
Request Method: GET
Request URL: http://localhost:6060/
Django Version: 1.7b3
Python Version: 2.7.2
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
's3_folder_storage',
'convoy',
'palettecomp_djng')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'convoy.middleware.GzipHttpOnlyMiddleware')
Template error:
In template /Users/peterconerly/code/palettecomp_djng/templates/base.html, error at line 15
This backend doesn't support absolute paths.
5 : <head>
6 : <title>Palette Comp</title>
7 :
8 : {% load staticfiles %}
9 : {% load convoytags %}
10 : {% load get_range %}
11 :
12 : {% block css %}
13 :
14 :
15 : {% carpool css %}
16 : 'css/reset.css'
17 : 'css/bootstrap.css'
18 : {% endcarpool %}
19 :
20 :
21 : {% comment %}
22 : <link rel="stylesheet" type="text/css" href="{% convoy 'css/reset.css' %}" />
23 : <link rel="stylesheet" type="text/css" href="{% convoy 'css/bootstrap.css' %}" />
24 : {% endcomment %}
25 :
Traceback:
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/peterconerly/code/palettecomp_djng/palettecomp_djng/views.py" in index
18. context_instance=RequestContext(request))
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/shortcuts.py" in render_to_response
23. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
178. return t.render(context_instance)
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/template/base.py" in render
148. return self._render(context)
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/template/base.py" in _render
142. return self.nodelist.render(context)
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/template/base.py" in render
844. bit = self.render_node(node, context)
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/template/debug.py" in render_node
80. return node.render(context)
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/template/loader_tags.py" in render
56. result = self.nodelist.render(context)
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/template/base.py" in render
844. bit = self.render_node(node, context)
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/template/debug.py" in render_node
80. return node.render(context)
File "/Users/peterconerly/code/django-asset-convoy/convoy/templatetags/convoytags.py" in render
116. compressed_file_name = concatenate_and_hash(convoyable_paths, comment_key, self.format)
File "/Users/peterconerly/code/django-asset-convoy/convoy/utils.py" in concatenate_and_hash
110. processed = css_abs.get_and_process(path)
File "/Users/peterconerly/code/django-asset-convoy/convoy/utils.py" in get_and_process
49. self.abs_path = self.storage.path(path)
File "/Users/peterconerly/.virtualenvs/convoy/lib/python2.7/site-packages/django/core/files/storage.py" in path
87. raise NotImplementedError("This backend doesn't support absolute paths.")
Exception Type: NotImplementedError at /
Exception Value: This backend doesn't support absolute paths.
Currently, the requirement of running the runserver with --nostatic and also running collectstatic each time a static asset changes doesn't live up to the "no changes in your workflow" promise.
We need to fix that.
Makes django-asset-convoy work with 1.6 in addition to 1.7
(As a note to self, here's another compat.py https://github.com/kennethreitz/requests/blob/master/requests/compat.py )
Carpool should support setting the "async" attribute for javascript files.
This issue has come up recently in the HN/reddit sphere: https://www.igvita.com/2014/05/20/script-injected-async-scripts-considered-harmful/
As it is now, CARPOOL_JS_TEMPLATE
can be over-written to turn on/off async behavior globally. However, if there is a need for both async and synchronous javascript carpool doesn't handle that case.
Changing the template tag signature to something like...
{% carpool <js/css> [extra] %}
... and the JS and CSS templates to something like ..
u'<link rel="stylesheet" href="%s" %s>\n'
u'<script type="text/javascript" src="%s" %s></script>\n'
... should be an easy, future proof api change
This task includes:
.travis.yml
Move the debugging stuff to logging
Ideally we would have a way to make static files justwork(tm) with the runserver when debug = True.
Also, convoy and carpool both won't work unless collectstatic has been run
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.