From 4ed86a457e4883d127b1dbee8d8f202c0a078962 Mon Sep 17 00:00:00 2001 From: Kristofer Koishigawa Date: Sat, 20 Oct 2018 19:47:50 +0900 Subject: [PATCH] fix(guide): Deleted and or moved the directories/files in client/src/guide and client/src/pages... (#19732) --- .../index.md | 61 ------------------- .../docker/more-about-containers}/index.md | 0 2 files changed, 61 deletions(-) delete mode 100644 client/src/pages/guide/english/miscellaneous/guide-to-store-media-files-of-django-app-to-aws-s3/index.md rename {client/src/pages/guide/english/containers/docker/More-about-containers => guide/english/containers/docker/more-about-containers}/index.md (100%) diff --git a/client/src/pages/guide/english/miscellaneous/guide-to-store-media-files-of-django-app-to-aws-s3/index.md b/client/src/pages/guide/english/miscellaneous/guide-to-store-media-files-of-django-app-to-aws-s3/index.md deleted file mode 100644 index 3d916de3ba..0000000000 --- a/client/src/pages/guide/english/miscellaneous/guide-to-store-media-files-of-django-app-to-aws-s3/index.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: Django-file-storage ---- -## Django Media Files and Static files Storage - -#### Steps to create AWS S3 Bucket (More information on S3 [Visit Here!](https://docs.aws.amazon.com/AmazonS3/latest/gsg/GetStartedWithS3.html)) - -* Open aws console and create IAM user for S3 bucket -* In services select S3 -* Create new S3 bucket in S3 console - -#### Steps to do in django app - -* install boto3 and Django-storages libraries. The commands to install these libraries are - -``` -pip install boto3 -pip install django-storages -``` -* Add storages to Installed Apps in ```settings.py``` - -* To work with satic assets only you have to add the following to your settings.py - -``` -AWS_ACCESS_KEY_ID = -AWS_SECRET_ACCESS_KEY = -AWS_STORAGE_BUCKET_NAME = -AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME -AWS_S3_OBJECT_PARAMETERS = { - 'CacheControl': 'max-age=86400', -} -AWS_LOCATION = 'static' - -STATICFILES_DIRS = [ - os.path.join(BASE_DIR, 'mysite/static'), -] -STATIC_URL = 'https://%s/%s/' % (AWS_S3_CUSTOM_DOMAIN, AWS_LOCATION) -STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' - -``` -* To work with both static and media assets you have to add the following to your settings.py - -``` -AWS_ACCESS_KEY_ID = -AWS_SECRET_ACCESS_KEY = -AWS_STORAGE_BUCKET_NAME = -AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME -AWS_S3_OBJECT_PARAMETERS = { - 'CacheControl': 'max-age=86400', -} -AWS_LOCATION = 'static' - -STATICFILES_DIRS = [ - os.path.join(BASE_DIR, 'mysite/static'), -] -STATIC_URL = 'https://%s/%s/' % (AWS_S3_CUSTOM_DOMAIN, AWS_LOCATION) -STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' - -DEFAULT_FILE_STORAGE = 'mysite.storage_backends.MediaStorage' - -``` diff --git a/client/src/pages/guide/english/containers/docker/More-about-containers/index.md b/guide/english/containers/docker/more-about-containers/index.md similarity index 100% rename from client/src/pages/guide/english/containers/docker/More-about-containers/index.md rename to guide/english/containers/docker/more-about-containers/index.md