Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In template:
- {% compress css %}
- <link rel="stylesheet" type="text/css" href="/static/foundation/stylesheets/globals.css"/>
- <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}/foundation/stylesheets/grid.css" />
- {% endcompress %}
- In settings.py:
- COMPRESS_OFFLINE_CONTEXT = {
- 'STATIC_URL': STATIC_URL,
- 'MEDIA_URL': MEDIA_URL,
- }
- Debug shows:
- /Users/peppe/Envs/Pipiki/lib/python2.7/site-packages/compressor/templatetags/compress.py in render
- rendered_output = self.render_output(compressor, forced)
- context
- [[{'paginator': <django.core.paginator.Paginator object at 0x102c20950>, 'page_obj': <Page 1 of 16>}, {'csrf_token': <django.utils.functional.__proxy__ object at 0x102ee1850>}, {'perms': <django.utils.functional.__proxy__ object at 0x102ee1890>, 'messages': <django.utils.functional.__proxy__ object at 0x102ee1910>, 'user': <django.utils.functional.SimpleLazyObject object at 0x102ee18d0>}, {'MEDIA_URL': '/media/'}, {'compressed': {'name': None}, 'STATIC_URL': '/static/'}]]
Advertisement
Add Comment
Please, Sign In to add comment