Permalink
Browse files

adding a cache_bust manage command

it makes a build.py that lets us use BUILD_ID for assets, taken from 
jingo_minify (since currently i only need the BUILD_ID)
  • Loading branch information...
1 parent 6417482 commit 44439a07312c4ed4f7dcf96a2bccf392fe4d9bcd @seanmonstar seanmonstar committed Nov 2, 2011
View
@@ -1,5 +1,7 @@
adminmedia
build
+build.py
+ide-min.js
flightdeckenv
flightdeck/media/jetpack
flightdeck/media/tutorial
No changes.
No changes.
@@ -0,0 +1,20 @@
+import os
+import time
+
+from django.core.management.base import BaseCommand
+from django.conf import settings
+
+class Command(BaseCommand):
+ """
+ Updates build.py with a new BUILD_ID that can be used for assets.
+ """
+
+ def handle(self, *args, **kwargs):
+ build_id = hex(int(time.time()))[2:]
+
+ build_id_file = os.path.realpath(os.path.join(settings.ROOT,
+ 'build.py'))
+
+ with open(build_id_file, 'w') as f:
+ f.write('BUILD_ID = "%s"' % build_id)
+ f.write('\n')

0 comments on commit 44439a0

Please sign in to comment.