diff --git a/lib/static_replace.py b/lib/static_replace.py
new file mode 100644
index 0000000000..d820990740
--- /dev/null
+++ b/lib/static_replace.py
@@ -0,0 +1,19 @@
+from staticfiles.storage import staticfiles_storage
+import re
+
+PREFIX = '/static/'
+STATIC_PATTERN = re.compile(r"""
+(?P['"]) # the opening quotes
+{prefix} # the prefix
+.*? # everything else in the url
+(?P=quote) # the first matching closing quote
+""".format(prefix=PREFIX), re.VERBOSE)
+PREFIX_LEN = len(PREFIX)
+
+def replace(static_url):
+ quote = static_url[0]
+ url = staticfiles_storage.url(static_url[1+PREFIX_LEN:-1])
+ return "".join([quote, url, quote])
+
+def replace_urls(text):
+ return STATIC_PATTERN.sub(replace, text)
diff --git a/rakefile b/rakefile
index fa2b3e946c..fcfe49776a 100644
--- a/rakefile
+++ b/rakefile
@@ -40,7 +40,7 @@ task :package do
set -x
chown -R makeitso:makeitso #{INSTALL_DIR_PATH}
-
+
service gunicorn stop
rm -f #{LINK_PATH}
ln -s #{INSTALL_DIR_PATH} #{LINK_PATH}
diff --git a/templates/main.html b/templates/main.html
index bf80160580..10532e601e 100644
--- a/templates/main.html
+++ b/templates/main.html
@@ -23,8 +23,10 @@
<%block name="headextra"/>
-
-
+
+
">
diff --git a/templates/problem.html b/templates/problem.html
index cd332f1b74..750fe7f0cc 100644
--- a/templates/problem.html
+++ b/templates/problem.html
@@ -1,3 +1,4 @@
+<%namespace name='static' file='static_content.html'/>