Enable testing minified files in dev

(imported from commit 257b8547849a85c447319d3d211f2c989616ce64)
This commit is contained in:
Keegan McAllister
2013-01-30 17:35:24 -05:00
parent 6990260b59
commit 638b8d29bc
3 changed files with 19 additions and 3 deletions

View File

@@ -236,6 +236,11 @@ PIPELINE_YUI_BINARY = '/usr/bin/env yui-compressor'
# event handlers defined in HTML.
PIPELINE_DISABLE_WRAPPER = True
# To use minified files in dev, uncomment:
#PIPELINE = True
# You will need to run ./tools/update-prod-static after changing static files.
USING_RABBITMQ = DEPLOYED
# This password also appears in servers/configure-rabbitmq

View File

@@ -85,4 +85,11 @@ urlpatterns = patterns('',
url(r'^notify_pointer_update$', 'zephyr.tornadoviews.notify_pointer_update'),
)
# Static file serving in dev is now handled by django.contrib.staticfiles
if not settings.DEPLOYED:
use_prod_static = getattr(settings, 'PIPELINE', False)
static_root = os.path.join(settings.SITE_ROOT,
'../prod-static/serve' if use_prod_static else '../zephyr/static')
urlpatterns += patterns('',
url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': static_root}))

View File

@@ -46,8 +46,12 @@ os.chdir(path.join(path.dirname(__file__), '..'))
# and all of the processes they spawn.
os.setpgrp()
for cmd in ['python manage.py runserver %s localhost:%d' % (manage_args, django_port),
'python manage.py runtornado %s localhost:%d' % (manage_args, tornado_port)]:
# Pass --nostatic because we configure static serving ourselves in
# humbug/urls.py.
for cmd in ['python manage.py runserver --nostatic %s localhost:%d'
% (manage_args, django_port),
'python manage.py runtornado %s localhost:%d'
% (manage_args, tornado_port)]:
subprocess.Popen(cmd, shell=True)
class Resource(resource.Resource):