Coder Social home page Coder Social logo

django-asset-convoy's People

Contributors

pconerly avatar tedtieken avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

django-asset-convoy's Issues

Carpool cache keys based on pre-processed filenames lead to stale versions being served

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

Fix Storage.post_process overrides to be consistent with 1.7.rc1

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

Add tests for template tags

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.

`carpool` breaks with `NotImplimentedError`

@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.

Address async javascript

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

Travis CI integration

This task includes:

  • Adding a .travis.yml
  • Make sure convoy can be installed in travis
  • Setting up unittest to be run from .travis.yml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.