Skip to content
This repository
Browse code

half-ass attempt to make django-pipeline work

  • Loading branch information...
commit ad2728994e2970c220a32050fd22eb248d0e5dca 1 parent 2fbf537
David Cramer dcramer authored
62 src/sentry/conf/server.py
@@ -142,7 +142,7 @@
142 142 'django.contrib.sites',
143 143 'django.contrib.staticfiles',
144 144
145   - 'compressor',
  145 + 'pipeline',
146 146 'crispy_forms',
147 147 'djcelery',
148 148 'gunicorn',
@@ -168,17 +168,61 @@
168 168 else:
169 169 LESS_BIN = 'lessc'
170 170
171   -# XXX: There is a bug in django-compressor that causes it to incorrectly handle
172   -# relative URLs in precompiled files (less) when compression is disabled
173   -COMPRESS_ENABLED = True
174   -COMPRESS_URL = STATIC_URL
175   -COMPRESS_OUTPUT_DIR = 'CACHE'
176   -COMPRESS_PRECOMPILERS = (
177   - ('text/less', '%s --strict-imports {infile} {outfile}' % (LESS_BIN,)),
  171 +PIPELINE = False
  172 +PIPELINE_CSS = {
  173 + 'lib': {
  174 + 'source_filenames': (
  175 + 'scripts/lib/select2/select2.css',
  176 + ),
  177 + 'output_filename': 'styles/vendor.css',
  178 + },
  179 + 'sentry': {
  180 + 'source_filenames': (
  181 + 'less/sentry.less',
  182 + ),
  183 + 'output_filename': 'styles/sentry.css',
  184 + },
  185 +}
  186 +
  187 +PIPELINE_JS = {
  188 + 'vendor': {
  189 + 'source_filenames': (
  190 + 'scripts/lib/jquery.js',
  191 + 'scripts/lib/jquery.animate-colors-min.js',
  192 + 'scripts/lib/jquery.clippy.min.js',
  193 + 'scripts/lib/jquery.cookie.js',
  194 + 'scripts/lib/jquery.flot.min.js',
  195 + 'scripts/lib/json2.js',
  196 + 'scripts/lib/underscore.js',
  197 + 'scripts/lib/backbone.js',
  198 + 'scripts/lib/select2/select2.js',
  199 + 'scripts/lib/bootstrap.js',
  200 + ),
  201 + 'output_filename': 'scripts/vendor.js',
  202 + },
  203 + 'sentry': {
  204 + 'source_filenames': (
  205 + 'scripts/core.js',
  206 + 'scripts/models.js',
  207 + 'scripts/templates.js',
  208 + 'scripts/utils.js',
  209 + 'scripts/collections.js',
  210 + 'scripts/views.js',
  211 + 'scripts/app.js',
  212 + ),
  213 + 'output_filename': 'scripts/sentry.js',
  214 + }
  215 +}
  216 +
  217 +PIPELINE_COMPILERS = (
  218 + 'pipeline.compilers.less.LessCompiler',
178 219 )
179 220
  221 +PIPELINE_LESS_BINARY = LESS_BIN
  222 +PIPELINE_LESS_ARGUMENTS = '--strict-imports'
  223 +
  224 +# STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
180 225 STATICFILES_FINDERS = (
181   - "compressor.finders.CompressorFinder",
182 226 "django.contrib.staticfiles.finders.FileSystemFinder",
183 227 "django.contrib.staticfiles.finders.AppDirectoriesFinder",
184 228 )
43 src/sentry/templates/sentry/layout.html
... ... @@ -1,4 +1,4 @@
1   -{% load compress %}
  1 +{% load compressed %}
2 2 {% load i18n %}
3 3 {% load sentry_helpers %}
4 4
@@ -11,10 +11,8 @@
11 11 <link href="{% url sentry-media "sentry" "images/favicon.png" %}" rel="shortcut icon" type="image/png"/>
12 12
13 13 {% block css %}
14   - {% compress css %}
15   - <link href="{% url sentry-media "sentry" "scripts/lib/select2/select2.css" %}" rel="stylesheet" type="text/css"/>
16   - <link href="{% url sentry-media "sentry" "less/sentry.less" %}" rel="stylesheet" type="text/less"/>
17   - {% endcompress %}
  14 + {% compressed_css 'vendor' %}
  15 + {% compressed_css 'sentry' %}
18 16 {% endblock %}
19 17
20 18 <title>{% block title %}Sentry{% endblock %}</title>
@@ -23,35 +21,14 @@
23 21 <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/html5shiv.js" %}"></script>
24 22 <![endif]-->
25 23 {% block scripts %}
26   - {% compress js %}
27   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/jquery.js" %}"></script>
28   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/jquery.animate-colors-min.js" %}"></script>
29   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/jquery.clippy.min.js" %}"></script>
30   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/jquery.cookie.js" %}"></script>
31   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/jquery.flot.min.js" %}"></script>
32   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/json2.js" %}"></script>
33   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/underscore.js" %}"></script>
34   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/backbone.js" %}"></script>
35   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/select2/select2.js" %}"></script>
36   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/bootstrap.js" %}"></script>
37   - {% endcompress %}
38   - {% compress js %}
39   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/core.js" %}"></script>
40   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/models.js" %}"></script>
41   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/templates.js" %}"></script>
42   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/utils.js" %}"></script>
43   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/collections.js" %}"></script>
44   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/views.js" %}"></script>
45   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/app.js" %}"></script>
46   - {% endcompress %}
  24 + {% compressed_js 'vendor' %}
  25 + {% compressed_js 'sentry' %}
47 26 {% comment %}
48 27 The sentry.* javascript is deprecated.
49 28 {% endcomment %}
50   - {% compress js %}
51   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/sentry.core.js" %}"></script>
52   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/sentry.charts.js" %}"></script>
53   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/sentry.stream.js" %}"></script>
54   - {% endcompress %}
  29 + <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/sentry.core.js" %}"></script>
  30 + <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/sentry.charts.js" %}"></script>
  31 + <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/sentry.stream.js" %}"></script>
55 32 <script type="text/javascript">
56 33 Sentry.config({
57 34 urlPrefix: {{ URL_PREFIX|to_json|safe }},
@@ -71,9 +48,7 @@
71 48 {% endblock %}
72 49
73 50 {% if USE_JS_CLIENT and INTERNAL_PROJECT %}
74   - {% compress js %}
75   - <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/raven.js" %}"></script>
76   - {% endcompress %}
  51 + <script type="text/javascript" src="{% url sentry-media "sentry" "scripts/lib/raven.js" %}"></script>
77 52 <script type="text/javascript">
78 53 Raven.config({{ INTERNAL_PROJECT.dsn|to_json|safe }});
79 54 window.onerror = Raven.process;
2  src/sentry/web/frontend/generic.py
@@ -54,8 +54,6 @@ def static_media(request, module, path, root=None):
54 54 document_root = root
55 55 elif module == 'sentry':
56 56 document_root = os.path.join(settings.MODULE_ROOT, 'static', module)
57   - elif module == dj_settings.COMPRESS_OUTPUT_DIR:
58   - document_root = os.path.join(dj_settings.STATIC_ROOT, module)
59 57 elif module not in dj_settings.INSTALLED_APPS:
60 58 raise Http404('Invalid module provided.')
61 59 else:

0 comments on commit ad27289

Please sign in to comment.
Something went wrong with that request. Please try again.