{ "info": { "author": "Benjamin W Stookey", "author_email": "ben.stookey@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "# django-s3-folder-storage\n\n[![Build Status](https://travis-ci.org/jamstooks/django-s3-folder-storage.svg)](https://travis-ci.org/jamstooks/django-s3-folder-storage)\n[![Code Climate](https://codeclimate.com/github/jamstooks/django-s3-folder-storage/badges/gpa.svg)](https://codeclimate.com/github/jamstooks/django-s3-folder-storage)\n\n\nQuick extension of django-storages' [S3BotoStorage](http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html) to allow separate folders for uploaded and static media within an S3 bucket.\n\n## Overview\n\nMany of my sites use the same configuration: **static** files are stored in `//s3.amazonaws.com//static/` and **uploaded** files are stored somewhere under `//s3.amazonaws.com//media/`. Instead of extending S3BotoStorage in every project I decided to build a package. The names of those folders are configurable in `settings.py`.\n\n## Installation\n\nUse `pip` to install from PyPI:\n\n\tpip install django-s3-folder-storage\n\nAdd `s3_folder_storage` to your settings.py file:\n\n\tINSTALLED_APPS = (\n\t ...\n\t 's3_folder_storage',\n\t ...\n\t)\n\n## Configuration\n\nYou are essentially using `django-storages` for S3 hosting, so you will be using their settings. The two settings that are specific to `django-s3-folder-storage` are `DEFAULT_S3_PATH` and `STATIC_S3_PATH`.\n\nHere's an example:\n\n\tDEFAULT_FILE_STORAGE = 's3_folder_storage.s3.DefaultStorage'\n\tDEFAULT_S3_PATH = \"media\"\n\tSTATICFILES_STORAGE = 's3_folder_storage.s3.StaticStorage'\n\tSTATIC_S3_PATH = \"static\"\n\tAWS_ACCESS_KEY_ID = {{ your key id here }}\n\tAWS_SECRET_ACCESS_KEY = {{ your secret key here }}\n\tAWS_STORAGE_BUCKET_NAME = {{ your bucket name here }}\n\n\tMEDIA_ROOT = '/%s/' % DEFAULT_S3_PATH\n\tMEDIA_URL = '//s3.amazonaws.com/%s/media/' % AWS_STORAGE_BUCKET_NAME\n\tSTATIC_ROOT = \"/%s/\" % STATIC_S3_PATH\n\tSTATIC_URL = '//s3.amazonaws.com/%s/static/' % AWS_STORAGE_BUCKET_NAME\n\tADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'\n\n## Troubleshooting\n\nDepending on how you have your buckets configured and if you want to use SSL,\nyou may need to use something like the following:\n\n\tMEDIA_URL = 'https://%s.s3.amazonaws.com/media/' % AWS_STORAGE_BUCKET_NAME\n\tSTATIC_URL = 'https://%s.s3.amazonaws.com/static/' % AWS_STORAGE_BUCKET_NAME\n\nAs a first step, I recommend trying to get the `collectstatic` management\ncommand working within your project:\n\n\tpython manage.py collectstatic\n\nYou can also run the tests:\n\n\tpython manage.py test s3_folder_storage\n\nto confirm that files are being written to S3\n\n## Contributing\n\nThink this needs something else? To contribute to `django-s3-folder-storage` create a fork on github. Clone your fork, make some changes, and submit a pull request.\n\nBugs are great contributions too! Feel free to add an issue on github.", "description_content_type": null, "docs_url": "https://pythonhosted.org/django-s3-folder-storage/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jamstooks/django-s3-folder-storage", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-s3-folder-storage", "package_url": "https://pypi.org/project/django-s3-folder-storage/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-s3-folder-storage/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jamstooks/django-s3-folder-storage" }, "release_url": "https://pypi.org/project/django-s3-folder-storage/0.5/", "requires_dist": null, "requires_python": null, "summary": "Quick extension of django-storages' S3BotoStorage to allow separate folders for uploaded and static media within an S3 bucket.", "version": "0.5" }, "last_serial": 2400000, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "403ef3bcc50f66ed2ce082ef6e61894e", "sha256": "552dc82a0d9f6e80b08ac2f604331c013378437a28c811765534a45f9ad3d874" }, "downloads": -1, "filename": "django-s3-folder-storage-0.1.tar.gz", "has_sig": false, "md5_digest": "403ef3bcc50f66ed2ce082ef6e61894e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3101, "upload_time": "2012-07-04T01:12:25", "url": "https://files.pythonhosted.org/packages/ee/a5/f8d982ac9dfa17fc80e03c4e08eddb81e75ae8de1946b856f0cbf18a181e/django-s3-folder-storage-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "bea121f6170d0f200d1f49279a7ff0a0", "sha256": "0e685b41811f749a6ae1739e5992b0ec710906706875c5046b4e46528266df33" }, "downloads": -1, "filename": "django-s3-folder-storage-0.2.tar.gz", "has_sig": false, "md5_digest": "bea121f6170d0f200d1f49279a7ff0a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4788, "upload_time": "2013-11-25T20:04:45", "url": "https://files.pythonhosted.org/packages/78/d8/6a40ea7eab75b7eadfcda768c7cbda0bae239c35a30b16f79b6302cea5e2/django-s3-folder-storage-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "7591323975d354767bf5a09cb2af9612", "sha256": "e66a99a661c3d1554345e74a1b96e0f8361ca71937f8d8aa6d497ec3f923d3d8" }, "downloads": -1, "filename": "django-s3-folder-storage-0.3.tar.gz", "has_sig": false, "md5_digest": "7591323975d354767bf5a09cb2af9612", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4745, "upload_time": "2015-09-01T04:35:00", "url": "https://files.pythonhosted.org/packages/ec/90/61e36dd914e4011b3b73ec961befdfaa67a6ea7a4a64fbb086e52a7f5644/django-s3-folder-storage-0.3.tar.gz" } ], "0.4": [], "0.5": [ { "comment_text": "", "digests": { "md5": "6a6c7c3755fdba09c7693715254b2438", "sha256": "eb5fd3994726f5b87ddc0ea1a6f1af3f598f9d743127c27d6dae111d18a79abe" }, "downloads": -1, "filename": "django-s3-folder-storage-0.5.tar.gz", "has_sig": false, "md5_digest": "6a6c7c3755fdba09c7693715254b2438", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5036, "upload_time": "2016-10-14T19:15:18", "url": "https://files.pythonhosted.org/packages/89/8c/9f07b74af0faac7623b51e7eb81f4ca670f52f07d11212793082bba168c1/django-s3-folder-storage-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6a6c7c3755fdba09c7693715254b2438", "sha256": "eb5fd3994726f5b87ddc0ea1a6f1af3f598f9d743127c27d6dae111d18a79abe" }, "downloads": -1, "filename": "django-s3-folder-storage-0.5.tar.gz", "has_sig": false, "md5_digest": "6a6c7c3755fdba09c7693715254b2438", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5036, "upload_time": "2016-10-14T19:15:18", "url": "https://files.pythonhosted.org/packages/89/8c/9f07b74af0faac7623b51e7eb81f4ca670f52f07d11212793082bba168c1/django-s3-folder-storage-0.5.tar.gz" } ] }