{ "info": { "author": "Body Labs", "author_email": "paul.melnikow@bodylabs.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "drf-to-s3\n=========\n\n`Django REST Framework `__ interface\nfor direct upload to S3. Designed for browser-based clients using `Fine\nUploader `__ and API clients.\n\nFeatures\n--------\n\nHandles browser-based uploads\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n1. Signs `policy\n documents `__\n for the `POST\n API `__.\n2. Provides an empty response to use as a success action redirect with\n old browsers (IE 9 and Android 2.3.x) which do not support the File\n API, instead using a dynamically generated iframe.\n3. Provides a framework for your upload-complete callback, which should\n copy the file to storage and take whatever other action is needed,\n such as creating model objects.\n\nSee this `Fine Uploader blog\npost `__\nfor a long explanation of these responsibilities.\n\nHandles API-client uploads\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe library provides a streamlined interface suitable for programmatic\nuploads by non-browser-based API clients:\n\n1. Provides signed URIs for the `REST PUT Object\n API `__.\n2. Provides an upload-complete callback.\n\nDesigned for security\n---------------------\n\nThis library's design goal is to be secure by default. To that end, it\nmakes two recommendations:\n\n1. Send your uploads to an \"uploads\" bucket, and make them private. This\n simplifies the namespacing used to segregate uploads by user, and\n discourages read-write ACLs.\n2. Create an account which has the minimum permission required on your\n uploads bucket, and use that account to sign users' policy documents.\n3. Move the files into a storage bucket during the completion callback,\n with either private or read-only ACLs. The library provides a view\n and serializer you can subclass to accomplish this easily.\n4. Use Fine Uploader's\n ```objectProperties.key`` `__\n property to incorporate the username as a prefix in the key. If you\n don't already have access to the username in the client, you can use\n the library's middleware to set a cookie with the prefix.\n5. Be sure to specify an ``https`` endpoint url when you configure Fine\n Uploader.\n6. Set a one-day expiration policy which automatically deletes stale,\n incomplete uploads. This step is mainly to save you money.\n\nIf you're willing to take what hopefully is sensible-sounding advice, go\non to the next section. If you want to know *why*, see the discussion in\nSECURITY.md.\n\nIf you don't want to use it as designed, you can use the utility classes\nand naive serializers to create your own components.\n\nStatus\n------\n\nThis project is functional pre-alpha. Most significantly it needs better\ndocumentation.\n\n|Build Status|\n\nInstallation\n------------\n\nRequires `Django REST Framework `__,\na great toolkit for building Web APIs in Django.\n\n::\n\n pip install drf_to_s3\n\nThis will install the remaining dependencies:\n`boto `__, and\n`querystring\\_parser `__\nwhich handles nested keys within ``uploadSuccess.params``.\n\nHow to use\n----------\n\n1. Include ``drf_to_s3.urls`` in your site (or if you prefer, redefine\n them).\n2. If you want to use nested dictionaries in your success callback, you\n must disable Django REST Framework's options for overriding the HTTP\n method and content. You probably aren't using these options, and they\n `interfere with the view's use of a custom form\n parser `__.\n\n ::\n\n REST_FRAMEWORK = { \n 'FORM_METHOD_OVERRIDE': None,\n 'FORM_CONTENT_OVERRIDE': None,\n }\n\n3. Create an temporary bucket for uploads.\n4. Set the CORS policy on that bucket.\n5. Create a user which only has PutObject access to that bucket.\n6. Add Fine Uploader to your front end.\n7. Configure Fine Uploader:\n\n - Keys\n - ``request.key``\n - access key\n\nLimitations\n-----------\n\nUsers must be logged in to upload. Anonymous uploads currently aren't\nsupported.\n\nDeletes during upload are not supported, but would be easy to add.\n\nContributing\n------------\n\n- Issue Tracker: https://github.com/bodylabs/drf-to-s3/issues\n- Source Code: https://github.com/bodylabs/drf-to-s3\n\nUnit tests:\n~~~~~~~~~~~\n\n::\n\n rake create_venv\n . .venv/bin/activate\n rake install\n rake test\n\nUnit tests against S3:\n~~~~~~~~~~~~~~~~~~~~~~\n\n1. If it's not already installed on your system, install ``foreman``.\n You can get it from RubyGems with ``gem install foreman`` or install\n `Heroku Toolbelt `__.\n2. Create an S3 bucket to use for testing.\n3. Create a ``.env`` file at the project root with the following three\n lines:\n\n - AWS\\_TEST\\_BUCKET=...\n - AWS\\_ACCESS\\_KEY\\_ID=...\n - AWS\\_SECRET\\_ACCESS\\_KEY=...\n\n4. Run the tests:\n\n ::\n\n source venv/bin/activate\n foreman run drf_to_s3/runtests/runtests.py\n\nIntegration tests:\n~~~~~~~~~~~~~~~~~~\n\n1. Install ``foreman``, create an S3 bucket, and set up your ``.env``\n file as described above.\n\n2. Install Node, NPM, the build dependences for Fine Uploader, and\n Chromium Driver:\n\n ::\n\n rake install_integration\n\n3. If you're not using Mac OS / Homebrew, you need to install Chromium\n Driver some other way.\n\n4. Choose a version of Fine Uploader to test:\n\n ::\n\n rake install_fine\n\n5. Build it into ``drf_to_s3/integration/static``:\n\n ::\n\n rake install_fine[4.2.2]\n\n6. Run the tests\n\n ::\n\n rake integration\n\nRunning integration tests on Sauce Labs:\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n1. Create a `Sauce Labs `__ account.\n2. In .env, set ``SAUCE_USERNAME`` and ``SAUCE_ACCESS_KEY``.\n3. Install `Sauce\n Connect `__.\n4. Start Sauce Connect:\n\n foreman run sh -c 'java -jar\n ~/code/Sauce-Connect-latest/Sauce-Connect.jar\n :math:`SAUCE_USERNAME `\\ SAUCE\\_ACCESS\\_KEY'\n\n5. Run the tests:\n\n WITH\\_SAUCE=1 rake integration\n\nBuilding the package for PyPi:\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis readme is written in Markdown, so there are dependencies for\nconverting it to reStructuredText. You only need this if you want to\ngenerate the PyPi package with long\\_description intact. Without it,\nyou'll just get a warning.\n\n::\n\n rake install_dist\n\nIf you're not using MacOS / Homebrew, you'll need to install Pandoc some\nother way.\n\nLicense\n-------\n\nThis project is licensed under the MIT license.\n\n.. |Build Status| image:: https://travis-ci.org/bodylabs/drf-to-s3.png?branch=master\n :target: https://travis-ci.org/bodylabs/drf-to-s3", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bodylabs/drf-to-s3", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "drf_to_s3", "package_url": "https://pypi.org/project/drf_to_s3/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/drf_to_s3/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bodylabs/drf-to-s3" }, "release_url": "https://pypi.org/project/drf_to_s3/0.7.7/", "requires_dist": null, "requires_python": null, "summary": "Django REST Framework Interface for direct upload to S3", "version": "0.7.7" }, "last_serial": 5753020, "releases": { "0.6.6": [ { "comment_text": "", "digests": { "md5": "a5b92bbb9db447c9b19948948eb26313", "sha256": "d0eeb5504af1baca472d6ae64052c18490bbfc6b742ff000f069971f69d66736" }, "downloads": -1, "filename": "drf_to_s3-0.6.6.tar.gz", "has_sig": false, "md5_digest": "a5b92bbb9db447c9b19948948eb26313", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11418, "upload_time": "2014-02-01T19:44:37", "url": "https://files.pythonhosted.org/packages/01/e5/f042ab5c6a4aed72a08e6960cc6d4b7a2dd89d220d3f8592c392dd6332e0/drf_to_s3-0.6.6.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "ee29b635ced8f6fe80ed79dcce3c1180", "sha256": "2274fc5d2aea8d08d0ed879f00bc40e78786b1230627ce8d080598ab9ac80816" }, "downloads": -1, "filename": "drf_to_s3-0.7.0.tar.gz", "has_sig": false, "md5_digest": "ee29b635ced8f6fe80ed79dcce3c1180", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12371, "upload_time": "2014-02-10T21:09:24", "url": "https://files.pythonhosted.org/packages/02/1e/1209a90642d937dd00267760d95c00b30e41dc069f22bd36f1e22b363735/drf_to_s3-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "4e879ba6eee8cfc06266f9417e5fb83b", "sha256": "93ceb9cb8ba74bcd7dac5da74732be33c008daad5836663ffbf07749d92d4f85" }, "downloads": -1, "filename": "drf_to_s3-0.7.1.tar.gz", "has_sig": false, "md5_digest": "4e879ba6eee8cfc06266f9417e5fb83b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15385, "upload_time": "2014-02-10T22:53:42", "url": "https://files.pythonhosted.org/packages/2c/64/7da0887d0e7a4cc177d65186ddd3ab86b9171b0e1eab64885c4dc1adfac2/drf_to_s3-0.7.1.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "23a2fbcba110134ec43062a86594269a", "sha256": "f29a2b22f87f104bf154050d48a73806c00beab384a55bfa34599d1cef10a1d6" }, "downloads": -1, "filename": "drf_to_s3-0.7.2.tar.gz", "has_sig": false, "md5_digest": "23a2fbcba110134ec43062a86594269a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12643, "upload_time": "2014-03-22T11:16:39", "url": "https://files.pythonhosted.org/packages/68/ad/c9b8e8129c476effaeebb10989f10afaeaf688af4c66ebad0d82926637cf/drf_to_s3-0.7.2.tar.gz" } ], "0.7.3": [ { "comment_text": "", "digests": { "md5": "13af2ec9dd812c07c71df116931584fb", "sha256": "096c5ba89a48f0288683f6dc335c838401828ade26b3009f89c0b1c953e2e214" }, "downloads": -1, "filename": "drf_to_s3-0.7.3.tar.gz", "has_sig": false, "md5_digest": "13af2ec9dd812c07c71df116931584fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15418, "upload_time": "2014-03-26T15:30:29", "url": "https://files.pythonhosted.org/packages/b3/86/02eddda6bc7262e675b13fe2ed202d70379ad1867176b45d5ab702e39bfd/drf_to_s3-0.7.3.tar.gz" } ], "0.7.4": [ { "comment_text": "", "digests": { "md5": "7ec5e6ea75b36be5c304a98f7f1d79ea", "sha256": "08b9de3e922972d8b70448bd207ca2ce1fc0443f5ddfbbf115e0faaaf276b4ac" }, "downloads": -1, "filename": "drf_to_s3-0.7.4.tar.gz", "has_sig": false, "md5_digest": "7ec5e6ea75b36be5c304a98f7f1d79ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12613, "upload_time": "2014-03-27T15:03:07", "url": "https://files.pythonhosted.org/packages/0b/ae/5c9ef062b1e877d3512cfdb0579cb03c53c56301493835e0291f52686501/drf_to_s3-0.7.4.tar.gz" } ], "0.7.5": [ { "comment_text": "", "digests": { "md5": "709ab65ce19ed22e704ec400d73e6a2b", "sha256": "bd09bfc1e786874943ddc5c83f6168181cbf5915e190fbc5ed8c1d6e8908b348" }, "downloads": -1, "filename": "drf_to_s3-0.7.5.tar.gz", "has_sig": false, "md5_digest": "709ab65ce19ed22e704ec400d73e6a2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15442, "upload_time": "2014-03-31T13:57:34", "url": "https://files.pythonhosted.org/packages/02/44/b132355e83ea1c4485ebc00699de9c9564db83721cdcb674ced336bcb8b1/drf_to_s3-0.7.5.tar.gz" } ], "0.7.6": [ { "comment_text": "", "digests": { "md5": "706b0169d56af630f46ed5a99d84e3c3", "sha256": "3045973c0df63b56e339c60f10c116bd1b3d9de09e3f143e8c7fc2afacd5ad20" }, "downloads": -1, "filename": "drf_to_s3-0.7.6.tar.gz", "has_sig": false, "md5_digest": "706b0169d56af630f46ed5a99d84e3c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15458, "upload_time": "2014-03-31T14:02:29", "url": "https://files.pythonhosted.org/packages/b1/0c/ed6345316d3dffe6b27c7c31be21af59ea87cf3d015844208cacdfd539e0/drf_to_s3-0.7.6.tar.gz" } ], "0.7.7": [ { "comment_text": "", "digests": { "md5": "e01b9f485dd1dde452ade93fddf5e7f8", "sha256": "2984217b57039da03cd2498313e547ace7fb21773c6a912015e0ee3cced971fd" }, "downloads": -1, "filename": "drf_to_s3-0.7.7.tar.gz", "has_sig": false, "md5_digest": "e01b9f485dd1dde452ade93fddf5e7f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15441, "upload_time": "2014-03-31T14:04:54", "url": "https://files.pythonhosted.org/packages/b4/b3/ae0076a4b4c17dd3d36a62c391c2e844c283853157ffdebbb8a1e4ca972f/drf_to_s3-0.7.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e01b9f485dd1dde452ade93fddf5e7f8", "sha256": "2984217b57039da03cd2498313e547ace7fb21773c6a912015e0ee3cced971fd" }, "downloads": -1, "filename": "drf_to_s3-0.7.7.tar.gz", "has_sig": false, "md5_digest": "e01b9f485dd1dde452ade93fddf5e7f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15441, "upload_time": "2014-03-31T14:04:54", "url": "https://files.pythonhosted.org/packages/b4/b3/ae0076a4b4c17dd3d36a62c391c2e844c283853157ffdebbb8a1e4ca972f/drf_to_s3-0.7.7.tar.gz" } ] }