What a mess
parent
18b47de71f
commit
2753bc9e98
|
@ -515,7 +515,3 @@ article.snipt {
|
|||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body {
|
||||
background: blue;
|
||||
}
|
||||
|
|
|
@ -62,8 +62,11 @@ MEDIA_URL = ''
|
|||
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
||||
# Example: "/home/media/media.lawrence.com/static/"
|
||||
STATIC_ROOT = os.path.join(BASE_PATH, 'static')
|
||||
STATICFILES_STORAGE = 'snipt.storage.CachedS3BotoStorage'
|
||||
STATIC_URL = 'https://dn2p0mzo970os.cloudfront.net/'
|
||||
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
|
||||
if DEBUG:
|
||||
STATIC_URL = '/media/'
|
||||
else:
|
||||
STATIC_URL = 'https://dn2p0mzo970os.cloudfront.net/'
|
||||
|
||||
# S3 Settings
|
||||
AWS_ACCESS_KEY_ID = 'AKIAJTFDHBCXHJLXINKQ'
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
from django.core.files.storage import get_storage_class
|
||||
from storages.backends.s3boto import S3BotoStorage
|
||||
|
||||
class CachedS3BotoStorage(S3BotoStorage):
|
||||
"""
|
||||
S3 storage backend that saves the files locally, too.
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CachedS3BotoStorage, self).__init__(*args, **kwargs)
|
||||
self.local_storage = get_storage_class(
|
||||
"compressor.storage.CompressorFileStorage")()
|
||||
|
||||
def save(self, name, content):
|
||||
name = super(CachedS3BotoStorage, self).save(name, content)
|
||||
self.local_storage._save(name, content)
|
||||
return name
|
||||
|
||||
def path(self, name):
|
||||
return self.local_storage.path(name)
|
|
@ -2,24 +2,26 @@
|
|||
<html lang="en" class="{% block html-class %}{% endblock %}">
|
||||
<head>
|
||||
|
||||
{% load compress %}
|
||||
|
||||
<title>{% block page-title %}Snipt{% endblock %}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="Long-term memory for coders. Share and store code snippets." />
|
||||
|
||||
{% compress css %}
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}css/reset.css" />
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}css/themes.css" />
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.less" />
|
||||
{% endcompress %}
|
||||
{% compress js %}
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.js"></script>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.infieldlabel.js"></script>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.hotkeys.js"></script>
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}css/reset.css" />
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}css/themes.css" />
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.js"></script>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.infieldlabel.js"></script>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.hotkeys.js"></script>
|
||||
|
||||
{% if debug %}
|
||||
<link rel="stylesheet/less" href="{{ STATIC_URL }}css/style.less" />
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/less.js"></script>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/coffee-script.js"></script>
|
||||
<script type="text/coffeescript" src="{{ STATIC_URL }}js/script.coffee"></script>
|
||||
{% endcompress %}
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" />
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/script.js"></script>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<!--[if IE]>
|
||||
<style type="text/css">
|
||||
|
|
Loading…
Reference in New Issue