mirror of https://github.com/wooey/Wooey.git
Update details and fix examples on aws.rst (#174)
* Update django-storages suggestion The django-storages-redux is now the canonical version of django-storages. * Split joined lines and reindent others The newlines between some lines in the code examples had disappeared. Also changes which line the code marker is on for some lines. * Add myself to the contributors list as per PR #173
This commit is contained in:
parent
c06797a695
commit
8b884ddf50
|
@ -7,6 +7,8 @@ These are the people who have provided various forms of contributions to Wooey (
|
|||
|
||||
* **[Mike DePalatis](https://github.com/mivade)**
|
||||
|
||||
* **[Padraic Harley](https://github.com/pauricthelodger)**
|
||||
|
||||
* **[Hottwaj](https://github.com/hottwaj)**
|
||||
|
||||
* **[Ryosuke Ito](https://github.com/manicmaniac)**
|
||||
|
|
36
docs/aws.rst
36
docs/aws.rst
|
@ -11,7 +11,7 @@ Before getting started, this guide assumes you have several things setup:
|
|||
* An AWS account
|
||||
* An S3 Bucket
|
||||
* An IAM user/group with full access to the S3 bucket (remember to add your user to the IAM group controlling the bucket!)
|
||||
* Are using a storage app in Django. We recommend `django-storages-redux <https://github.com/jschneier/django-storages>`_ as it is actively maintained as compared to django-storages.
|
||||
* Are using a storage app in Django. We recommend `django-storages <https://github.com/jschneier/django-storages>`_.
|
||||
|
||||
|
||||
Steps to Follow
|
||||
|
@ -50,15 +50,17 @@ Steps to Follow
|
|||
)
|
||||
|
||||
|
||||
# We have user authentication -- we need to use https (django-sslify)if not DEBUG:
|
||||
MIDDLEWARE_CLASSES = ['sslify.middleware.SSLifyMiddleware']+list(MIDDLEWARE_CLASSES)
|
||||
# We have user authentication -- we need to use https (django-sslify)
|
||||
if not DEBUG:
|
||||
MIDDLEWARE_CLASSES = ['sslify.middleware.SSLifyMiddleware'] + list(MIDDLEWARE_CLASSES)
|
||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||
|
||||
|
||||
ALLOWED_HOSTS = (
|
||||
'localhost',
|
||||
'127.0.0.1',
|
||||
"wooey.herokuapp.com",# put your site here)
|
||||
"wooey.herokuapp.com", # put your site here
|
||||
)
|
||||
|
||||
|
||||
AWS_CALLING_FORMAT = VHostCallingFormat
|
||||
|
@ -68,8 +70,10 @@ Steps to Follow
|
|||
AWS_SECRET_ACCESS_KEY = environ.get('AWS_SECRET_ACCESS_KEY', '')
|
||||
AWS_STORAGE_BUCKET_NAME = environ.get('AWS_STORAGE_BUCKET_NAME', '')
|
||||
AWS_AUTO_CREATE_BUCKET = True
|
||||
AWS_QUERYSTRING_AUTH = FalseAWS_S3_SECURE_URLS = True
|
||||
AWS_FILE_OVERWRITE = FalseAWS_PRELOAD_METADATA = True
|
||||
AWS_QUERYSTRING_AUTH = False
|
||||
AWS_S3_SECURE_URLS = True
|
||||
AWS_FILE_OVERWRITE = False
|
||||
AWS_PRELOAD_METADATA = True
|
||||
AWS_S3_CUSTOM_DOMAIN = environ.get('AWS_S3_CUSTOM_DOMAIN', '')
|
||||
|
||||
|
||||
|
@ -81,7 +85,8 @@ Steps to Follow
|
|||
)
|
||||
|
||||
|
||||
AWS_EXPIREY = 60 * 60 * 7AWS_HEADERS = {
|
||||
AWS_EXPIREY = 60 * 60 * 7
|
||||
AWS_HEADERS = {
|
||||
'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIREY,
|
||||
AWS_EXPIREY)
|
||||
}
|
||||
|
@ -89,24 +94,23 @@ Steps to Follow
|
|||
|
||||
STATIC_URL = 'http://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
|
||||
MEDIA_URL = '/user-uploads/'
|
||||
STATICFILES_STORAGE = DEFAULT_FILE_STORAGE = 'wooey.wooeystorage.CachedS3BotoStorage'WOOEY_EPHEMERAL_FILES = True
|
||||
STATICFILES_STORAGE = DEFAULT_FILE_STORAGE = 'wooey.wooeystorage.CachedS3BotoStorage'
|
||||
WOOEY_EPHEMERAL_FILES = True
|
||||
|
||||
In the above step, make sure you change wooey.herokuapp.com to your app's address.
|
||||
|
||||
Configuration Settings
|
||||
----------------------
|
||||
|
||||
Next, as part of any good app -- you should be storing your secret information in environmental variables instead of hard-coding them into the app. You will want to
|
||||
set these variables:
|
||||
Next, as part of any good app -- you should be storing your secret information in environmental
|
||||
variables instead of hard-coding them into the app. You will want to set these variables::
|
||||
|
||||
::
|
||||
AWS_ACCESS_KEY_ID=access_key
|
||||
AWS_SECRET_ACCESS_KEY=secret_key
|
||||
AWS_STORAGE_BUCKET_NAME=bucket_name
|
||||
|
||||
* If you are using Heroku, you can set them as follows:
|
||||
::
|
||||
If you are using Heroku, you can set them as follows::
|
||||
|
||||
heroku config:set -a wooey AWS_ACCESS_KEY_ID=access_key
|
||||
heroku config:set -a wooey AWS_SECRET_ACCESS_KEY=secret_key
|
||||
heroku config:set -a wooey AWS_STORAGE_BUCKET_NAME=bucket_name
|
||||
heroku config:set -a wooey AWS_ACCESS_KEY_ID=access_key
|
||||
heroku config:set -a wooey AWS_SECRET_ACCESS_KEY=secret_key
|
||||
heroku config:set -a wooey AWS_STORAGE_BUCKET_NAME=bucket_name
|
||||
|
|
Loading…
Reference in New Issue