Now on the bucket list :)

This commit is contained in:
Oliver Marks 2018-01-21 21:06:51 +00:00
parent c3f9a377c9
commit 276a87c0b3
6 changed files with 64 additions and 8 deletions

View File

@ -0,0 +1 @@
Place holder directory, each folder inside buckets folder is a fake digitalocean space or fake amazon bucket.

View File

@ -59,7 +59,7 @@ CACHES = {
# django-debug-toolbar # django-debug-toolbar
# ------------------------------------------------------------------------------ # ---------------------MDVTDNXFTRJSJBX9KWOJTMCGSNMYASEFNBPDUZJMGSPPCVMQRUZMZAEXDTIGHPZCP9JBGLVKGSJMZKPVV---------------------------------------------------------
MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware',) MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INSTALLED_APPS += ('debug_toolbar', ) INSTALLED_APPS += ('debug_toolbar', )
@ -80,6 +80,7 @@ DEBUG_TOOLBAR_CONFIG = {
# django-extensions # django-extensions
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
INSTALLED_APPS += ('django_extensions', ) INSTALLED_APPS += ('django_extensions', )
INSTALLED_APPS += ('storages', )
# TESTING # TESTING
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -147,3 +148,25 @@ LOGGING = {
PAYMENT_PROVIDERS['gocardless']['redirect_url'] = 'http://127.0.0.1:8180' PAYMENT_PROVIDERS['gocardless']['redirect_url'] = 'http://127.0.0.1:8180'
TEMPLATE_DEBUG = False TEMPLATE_DEBUG = False
AWS_S3_SECURE_URLS = False
AWS_ACCESS_KEY_ID = env('MINIO_ACCESS_KEY')
AWS_SECRET_ACCESS_KEY = env('MINIO_SECRET_KEY')
AWS_S3_ENDPOINT_URL = 'http://bucket:9000'
# AWS_S3_SECURE_URLS = True
# AWS_ACCESS_KEY_ID = env('DIGITALOCEAN_SPACE_KEY')
# AWS_SECRET_ACCESS_KEY = env('DIGITALOCEAN_SPACE_SECRET')
# AWS_S3_ENDPOINT_URL = 'https://ams3.digitaloceanspaces.com'
AWS_STORAGE_BUCKET_NAME = 'mhackspace'
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl': 'max-age=86400',
}
AWS_LOCATION = 'dev'
AWS_S3_SECURE_URLS = True
STATIC_URL = '%s/%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME, AWS_LOCATION)
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
COMPRESS_URL = STATIC_URL

View File

@ -223,3 +223,25 @@ ADMIN_URL = env('DJANGO_ADMIN_URL', default='trustee/')
# Your production stuff: Below this line define 3rd party library settings # Your production stuff: Below this line define 3rd party library settings
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
PAYMENT_PROVIDERS['gocardless']['redirect_url'] = 'https://test.maidstone-hackspace.org.uk'
AWS_S3_SECURE_URLS = True
AWS_ACCESS_KEY_ID = env('DIGITALOCEAN_SPACE_KEY')
AWS_SECRET_ACCESS_KEY = env('DIGITALOCEAN_SPACE_SECRET')
AWS_STORAGE_BUCKET_NAME = 'mhackspace'
AWS_S3_ENDPOINT_URL = 'https://ams3.digitaloceanspaces.com'
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl': 'max-age=86400',
}
AWS_LOCATION = 'stage'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'mysite/static'),
]
STATIC_URL = '%s/%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_STORAGE_BUCKET_NAME, AWS_LOCATION)
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
COMPRESS_URL = STATIC_URL

View File

@ -67,3 +67,9 @@ services:
command: celery -A mhackspace.celeryapp beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler command: celery -A mhackspace.celeryapp beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
#command: sleep 1h #command: sleep 1h
bucket:
image: minio/minio
env_file: .env
volumes:
- ./buckets:/data
command: server /data

View File

@ -10,6 +10,11 @@ django==1.11.4
# Configuration # Configuration
django-environ==0.4.3 django-environ==0.4.3
whitenoise==3.2.3 whitenoise==3.2.3
# Static and Media Storage
# ------------------------------------------------
boto3
django-storages==1.6.5
# django-storages-redux==1.3.2
# Forms # Forms
@ -44,7 +49,10 @@ redis>=2.10.5
rcssmin==1.0.6 rcssmin==1.0.6
django-compressor==2.1.1 django-compressor==2.1.1
django-sass-processor==0.5.4
#fix for use with s3 buckets merged in master, so next release we can remove this
#django-sass-processor==0.5.7
git+https://github.com/jrief/django-sass-processor.git
libsass==0.13.2 libsass==0.13.2
lxml==3.7.3 lxml==3.7.3
@ -67,9 +75,9 @@ django-filter==1.0.2
coreapi coreapi
# api libraries end # api libraries end
#martor==1.2.5 martor==1.2.5
git+git://github.com/olymk2/django-markdown-editor.git #git+git://github.com/olymk2/django-markdown-editor.git
# django-spirit # django-spirit
django-djconfig django-djconfig

View File

@ -9,10 +9,6 @@
gevent==1.2.2 gevent==1.2.2
gunicorn==19.7.1 gunicorn==19.7.1
# Static and Media Storage
# ------------------------------------------------
boto==2.47.0
django-storages-redux==1.3.2
# Email backends for Mailgun, Postmark, SendGrid and more # Email backends for Mailgun, Postmark, SendGrid and more