mirror of
https://github.com/nikdoof/vapemap.git
synced 2025-12-13 14:32:15 +00:00
Support S3 static file storage
This commit is contained in:
@@ -17,7 +17,6 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ALLOWED_HOSTS = [
|
ALLOWED_HOSTS = [
|
||||||
'127.0.0.1',
|
|
||||||
'vapemap.herokuapp.com',
|
'vapemap.herokuapp.com',
|
||||||
'vapemap.co.uk',
|
'vapemap.co.uk',
|
||||||
'vapemap.com',
|
'vapemap.com',
|
||||||
@@ -71,6 +70,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.flatpages',
|
'django.contrib.flatpages',
|
||||||
'gunicorn',
|
'gunicorn',
|
||||||
'south',
|
'south',
|
||||||
|
'storages',
|
||||||
'markdown_deux',
|
'markdown_deux',
|
||||||
'epiceditor',
|
'epiceditor',
|
||||||
'bootstrapform',
|
'bootstrapform',
|
||||||
@@ -155,3 +155,11 @@ HAYSTACK_CONNECTIONS = {
|
|||||||
'INDEX_NAME': 'vapemap-haystack',
|
'INDEX_NAME': 'vapemap-haystack',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not DEBUG:
|
||||||
|
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
|
||||||
|
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
|
||||||
|
AWS_STORAGE_BUCKET_NAME = os.environ['AWS_STORAGE_BUCKET_NAME']
|
||||||
|
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
|
||||||
|
S3_URL = 'http://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
|
||||||
|
STATIC_URL = S3_URL
|
||||||
@@ -14,4 +14,6 @@ django-epiceditor
|
|||||||
# Heroku
|
# Heroku
|
||||||
dj-database-url
|
dj-database-url
|
||||||
gunicorn
|
gunicorn
|
||||||
psycopg2
|
psycopg2
|
||||||
|
django-storages
|
||||||
|
boto
|
||||||
Reference in New Issue
Block a user