{ "info": { "author": "Alexis Bellido", "author_email": "a@zinibu.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "znbdownload\n=====================================================\n\nUpload media files to S3 and add support for private files.\n\nFeatures\n------------------------------------------------------------------------------\n\n-\n\nInstalling and Uninstalling Packages\n------------------------------------------------------------------------------\n\nInstalling in editable mode from local directory.\n\n.. code-block:: bash\n\n $ pip install -e /path/to/znbdownload/\n\nYou can remove the -e to install the package in the corresponding Python path, for example: /env/lib/python3.7/site-packages/znbdownload.\n\nList installed packages and uninstall.\n\n.. code-block:: bash\n\n $ pip list\n $ pip uninstall znbdownload\n\nInstalling from git using https.\n\n.. code-block:: bash\n\n $ pip install git+https://github.com/requests/requests.git#egg=requests\n $ pip install git+https://github.com/alexisbellido/znbdownload.git#egg=znbdownload\n\nThis package could be added to a pip requirements.txt file from its git repository or source directory.\n\n.. code-block:: bash\n\n git+https://github.com/alexisbellido/znbdownload.git#egg=znbdownload\n -e /path-to/znbdownload/\n\nor from PyPi, in this case passing a specific version.\n\n.. code-block:: bash\n\n znbdownload==0.2\n\nZnbDownload will require, and install if necessary, Django, boto3 and django-storages.\n\nUpdating Django Settings\n---------------------------------------------------------------------------------------\n\nAdd the following to INSTALLED_APPS\n\n.. code-block:: bash\n\n 'znbdownload.apps.ZnbDownloadConfig'\n\nMake sure these two are also installed.\n\n.. code-block:: bash\n\n 'storages'\n 'django.contrib.staticfiles'\n\n\nAmazon S3\n-----------------------------------------------\n\nSome notes to use S3 for storing Django files.\n\nCross-origin resource sharing (CORS) defines a way for client web applications that are loaded in one domain to interact with resources in a different domain.\n\nMore on `S3 access permissions `_.\n\nOption 1 (preferred): Resource-based policy.\n\nA bucket configured to be allow publc read access and full control by a IAM user that will be used from Django.\n\nCreate a IAM user. Write down the arn and user credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY).\n\nDon't worry about adding a user policy as you will be using a bucket policy to refer to this user by its arn.\n\nCreate an S3 bucket at url-of-s3-bucket.\n\nAssign it the following CORS configuration in the permissions tab.\n\n.. code-block:: bash\n\n \n \n *\n GET\n 3000\n Authorization\n \n \n\nGo to permissions, public access settings for the bucket and set these options to false or you won't be able to use * as Principal in the bucket policy:\n\n.. code-block:: bash\n\n Block new public ACLs and uploading public objects (Recommended)\n Remove public access granted through public ACLs (Recommended)\n Block new public bucket policies (Recommended)\n Block public and cross-account access if bucket has public policies (Recommended)\n\n\nand the following bucket policy (use the corresponding arn for the bucket and for the IAM user that will have full control).\n\n.. code-block:: bash\n\n {\n \"Version\": \"2012-10-17\",\n \"Id\": \"name-of-bucket\",\n \"Statement\": [\n {\n \"Sid\": \"PublicReadForGetBucketObjects\",\n \"Effect\": \"Allow\",\n \"Principal\": \"*\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::name-of-bucket/*\"\n },\n {\n \"Sid\": \"FullControlForBucketObjects\",\n \"Effect\": \"Allow\",\n \"Principal\": {\n \"AWS\": \"arn:aws:iam::364908532015:user/name-of-user\"\n },\n \"Action\": \"s3:*\",\n \"Resource\": [\n \"arn:aws:s3:::name-of-bucket\",\n \"arn:aws:s3:::name-of-bucket/*\"\n ]\n }\n ]\n }\n\n\nOption 2: user policy.\n\nA user configured to control an specific bucket.\n\nCreate an S3 bucket at url-of-s3-bucket.\n\nAssign it the following CORS configuration in the permissions tab.\n\n.. code-block:: bash\n\n \n \n \n *\n GET\n 3000\n Authorization\n \n \n\nCreate a user in IAM and assign it to this policy.\n\n.. code-block:: bash\n\n {\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"Stmt1394043345000\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:*\"\n ],\n \"Resource\": [\n \"arn:aws:s3:::url-of-s3-bucket/*\"\n ]\n }\n ]\n }\n\nThen create the user credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to connect from Django.\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alexisbellido/znbdownload", "keywords": "", "license": "BSD, see LICENSE file", "maintainer": "", "maintainer_email": "", "name": "znbdownload", "package_url": "https://pypi.org/project/znbdownload/", "platform": "", "project_url": "https://pypi.org/project/znbdownload/", "project_urls": { "Homepage": "https://github.com/alexisbellido/znbdownload" }, "release_url": "https://pypi.org/project/znbdownload/0.1/", "requires_dist": [ "Django (>=2.0)", "boto3 (<2,>=1.9.70)", "django-storages (<2,>=1.7.1)" ], "requires_python": ">=3", "summary": "A Django storage backend with versioning and S3 support.", "version": "0.1" }, "last_serial": 5487918, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2ce303c809e007021ef3ff2c0529af73", "sha256": "9ce67735873dac7db0a2b028969103c154ea10281538af3b1b06c00ce384034d" }, "downloads": -1, "filename": "znbdownload-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2ce303c809e007021ef3ff2c0529af73", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 24429, "upload_time": "2019-07-04T18:31:01", "url": "https://files.pythonhosted.org/packages/0d/7d/387c87fe7dd9f5cd53a4282f51cf2ef62115fe70aa70cc177ac13e3fb0a3/znbdownload-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "528976fe582c4d3028dcd0260b14aff1", "sha256": "5c187cb788d107926c9ffea0ded4bbdcf9523077fc37cf76973673cb4d7f14c7" }, "downloads": -1, "filename": "znbdownload-0.1.tar.gz", "has_sig": false, "md5_digest": "528976fe582c4d3028dcd0260b14aff1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 16733, "upload_time": "2019-07-04T18:31:03", "url": "https://files.pythonhosted.org/packages/78/b5/9ab1b536535b809ee04a6ccdb460c76ba73dcedee98da4047dedc44e16ed/znbdownload-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2ce303c809e007021ef3ff2c0529af73", "sha256": "9ce67735873dac7db0a2b028969103c154ea10281538af3b1b06c00ce384034d" }, "downloads": -1, "filename": "znbdownload-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2ce303c809e007021ef3ff2c0529af73", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 24429, "upload_time": "2019-07-04T18:31:01", "url": "https://files.pythonhosted.org/packages/0d/7d/387c87fe7dd9f5cd53a4282f51cf2ef62115fe70aa70cc177ac13e3fb0a3/znbdownload-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "528976fe582c4d3028dcd0260b14aff1", "sha256": "5c187cb788d107926c9ffea0ded4bbdcf9523077fc37cf76973673cb4d7f14c7" }, "downloads": -1, "filename": "znbdownload-0.1.tar.gz", "has_sig": false, "md5_digest": "528976fe582c4d3028dcd0260b14aff1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 16733, "upload_time": "2019-07-04T18:31:03", "url": "https://files.pythonhosted.org/packages/78/b5/9ab1b536535b809ee04a6ccdb460c76ba73dcedee98da4047dedc44e16ed/znbdownload-0.1.tar.gz" } ] }