Add a mechanism for cache-busting static files
This commit is contained in:
1 parent
5692a1373a
commit
eca8ccc613
7 files changed
+16
-12
No files matched your search
@@ -25,6 +25,8 @@ import traceback
|
||||
|
||||
from OpenSite.settings import PROJECT_PATH
|
||||
|
||||
OPENBENCH_STATIC_VERSION = 'v1'
|
||||
|
||||
OPENBENCH_CONFIG = None # Initialized by OpenBench/apps.py
|
||||
|
||||
def create_openbench_config():
|
||||
|
||||
+2
-1
@@ -33,7 +33,7 @@ from OpenBench.workloads.modify_workload import modify_workload
|
||||
from OpenBench.workloads.verify_workload import verify_workload
|
||||
from OpenBench.workloads.view_workload import view_workload
|
||||
|
||||
from OpenBench.config import OPENBENCH_CONFIG
|
||||
from OpenBench.config import OPENBENCH_CONFIG, OPENBENCH_STATIC_VERSION
|
||||
from OpenSite.settings import PROJECT_PATH
|
||||
|
||||
from OpenBench.models import *
|
||||
@@ -68,6 +68,7 @@ def render(request, template, content={}, always_allow=False, error=None, warnin
|
||||
|
||||
data = content.copy()
|
||||
data.update({ 'config' : OPENBENCH_CONFIG })
|
||||
data.update({ 'static_version' : OPENBENCH_STATIC_VERSION })
|
||||
|
||||
if OPENBENCH_CONFIG['require_login_to_view']:
|
||||
if not request.user.is_authenticated and not always_allow:
|
||||
|
||||
Reference in new issue
Block a user