{ "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": "znbstatic\n=====================================================\n\nCustom Django storage backend.\n\nFeatures\n------------------------------------------------------------------------------\n\n- Storage of assets managed by collectstatic on Amazon Web Services S3.\n- Versioning using a variable from Django's settings (https://example.com/static/css/styles.css?v=1.2)\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/znbstatic/\n\nYou can remove the -e to install the package in the corresponding Python path, for example: /env/lib/python3.7/site-packages/znbstatic.\n\nList installed packages and uninstall.\n\n.. code-block:: bash\n\n $ pip list\n $ pip uninstall znbstatic\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/znbstatic.git#egg=znbstatic\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/znbstatic.git#egg=znbstatic\n -e /path-to/znbstatic/\n\nor from PyPi, in this case passing a specific version.\n\n.. code-block:: bash\n\n znbstatic==0.2\n\nZnbstatic 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 'znbstatic.apps.ZnbStaticConfig'\n\nMake sure these two are also installed.\n\n.. code-block:: bash\n\n 'storages'\n 'django.contrib.staticfiles'\n\nAdd the znbstatic.context_processors.static_urls context processor to the correspoding template engine.\n\nUpdate or insert the following attributes.\n\n# if hosting the static files locally.\n# STATICFILES_STORAGE = 'znbstatic.storage.VersionedStaticFilesStorage'\n# STATIC_URL = '/static/'\n\n# use the following if using Amazon S3\nSTATICFILES_STORAGE = 'znbstatic.storage.VersionedS3StaticFilesStorage'\n\nAWS_ACCESS_KEY_ID = 'your-access-key-id'\nAWS_SECRET_ACCESS_KEY = 'your-secret-access-key'\n\nAWS_STORAGE_STATIC_BUCKET_NAME = 'static.example.com'\n\n# where is this used?\nAWS_S3_HOST = 's3.amazonaws.com'\n\nS3_USE_SIGV4 = True\nAWS_QUERYSTRING_AUTH = False\nAWS_DEFAULT_ACL = 'public-read'\nSTATIC_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_STATIC_BUCKET_NAME\n\nZNBSTATIC_VERSION = '0.1'\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/znbstatic", "keywords": "", "license": "BSD, see LICENSE file", "maintainer": "", "maintainer_email": "", "name": "znbstatic", "package_url": "https://pypi.org/project/znbstatic/", "platform": "", "project_url": "https://pypi.org/project/znbstatic/", "project_urls": { "Homepage": "https://github.com/alexisbellido/znbstatic" }, "release_url": "https://pypi.org/project/znbstatic/0.5/", "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.5" }, "last_serial": 5487961, "releases": { "0.1.dev1": [ { "comment_text": "", "digests": { "md5": "113e310996240a902e785264a9b0bc5a", "sha256": "4624e44b780e3a2e2aa17f8f6a499723f91ac484252dba40f9e92d9d63133cf0" }, "downloads": -1, "filename": "znbstatic-0.1.dev1-py3-none-any.whl", "has_sig": false, "md5_digest": "113e310996240a902e785264a9b0bc5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 6939, "upload_time": "2019-01-08T17:40:27", "url": "https://files.pythonhosted.org/packages/35/c0/e5908ab72a661fccaf4cbf72c404a425dac0692667103f578b6164b71a39/znbstatic-0.1.dev1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e437436d56dc41b487342f7d678e9f4", "sha256": "50a78c2641f0d4403cff4ad063532ffff029fee42d2b07a5b21e20b85eda9823" }, "downloads": -1, "filename": "znbstatic-0.1.dev1.tar.gz", "has_sig": false, "md5_digest": "2e437436d56dc41b487342f7d678e9f4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 5064, "upload_time": "2019-01-08T17:40:28", "url": "https://files.pythonhosted.org/packages/29/9e/7cabbf5c35dd914b840881e2a7484e66e0b619d760c347772d8be99248a4/znbstatic-0.1.dev1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "fe389b0aecf91617ea2b1acb6e8220c8", "sha256": "98544b4869be0b5aada6556c14526786bd335cd1f52261b33d2ae437d42e894e" }, "downloads": -1, "filename": "znbstatic-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "fe389b0aecf91617ea2b1acb6e8220c8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7270, "upload_time": "2019-01-08T17:51:41", "url": "https://files.pythonhosted.org/packages/a6/fc/efe29d6fd2e973e7dbb9fa813128c9f6f7dfa45845da9a3e51e17ed40719/znbstatic-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a229114dcd55362995e277f2366e8b24", "sha256": "949f1a70bcd6081b8cb932e0d94f530ae371656b5e7d8e29424978dafd5343e2" }, "downloads": -1, "filename": "znbstatic-0.2.tar.gz", "has_sig": false, "md5_digest": "a229114dcd55362995e277f2366e8b24", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 5554, "upload_time": "2019-01-08T17:51:42", "url": "https://files.pythonhosted.org/packages/4e/c1/3db6e92b95df43e6816a614fda071bd5e3d7931ed4d954b12a6bb5c31708/znbstatic-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "03f52b9cec1b9630770f70eef1058287", "sha256": "f12fedb18fb4a4a16d29ac3e89eaa2150b2a82cfee13de3a072d914df8ebbbd9" }, "downloads": -1, "filename": "znbstatic-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "03f52b9cec1b9630770f70eef1058287", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 14717, "upload_time": "2019-02-21T15:33:27", "url": "https://files.pythonhosted.org/packages/fe/87/b50cf0837bd7508c501f9c98257fe2c5cdf85fe86fe189ad54c3c788a24d/znbstatic-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "575939d79c6922f50f24fe620b6f9111", "sha256": "855d43773a3b02306fb29ea81f6c8111c440883e79b7029c041e186dac70aa3f" }, "downloads": -1, "filename": "znbstatic-0.3.tar.gz", "has_sig": false, "md5_digest": "575939d79c6922f50f24fe620b6f9111", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 13388, "upload_time": "2019-02-21T15:33:28", "url": "https://files.pythonhosted.org/packages/ec/72/203fccb7810c19644ba51d3d0797c83f27de392d3bb3780c6dc90ecee660/znbstatic-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "a70ad302c96544a8b6b20527ad36ecb4", "sha256": "0d11d0dec6b166766480e7d2ab53f9af42ad98bf10bc6187d60d58c6d75033e2" }, "downloads": -1, "filename": "znbstatic-0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "a70ad302c96544a8b6b20527ad36ecb4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 14769, "upload_time": "2019-07-04T18:29:12", "url": "https://files.pythonhosted.org/packages/cc/36/8f4c0bbd90ace13862f9e6bac2c66175503c0a88d158db44f8410c75f290/znbstatic-0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "71b246ee92381f95bc4119cce6077f2b", "sha256": "39ce8eba33751b2c7c338b4512a571708e29ad4975dc3421c8eb5467c6006ffe" }, "downloads": -1, "filename": "znbstatic-0.4.tar.gz", "has_sig": false, "md5_digest": "71b246ee92381f95bc4119cce6077f2b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 13326, "upload_time": "2019-07-04T18:29:14", "url": "https://files.pythonhosted.org/packages/14/a5/ce3c291a001695309940d9d969e7c5b171c759a3a4ae27427755bc0f4d56/znbstatic-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "a2804fbc6ee88e499473d6d05155439d", "sha256": "716c9c98c2845d1b1f5d0cd29a77700823fe147cee9e20459ad2e28ca4b928ab" }, "downloads": -1, "filename": "znbstatic-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "a2804fbc6ee88e499473d6d05155439d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 14765, "upload_time": "2019-07-04T18:44:29", "url": "https://files.pythonhosted.org/packages/15/bb/d47daa10a5757065a7b5973245dc3606fc8cea3e578ea56d4ac1ca326c14/znbstatic-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46a699f093745988e35ff76f95d7ad81", "sha256": "fae8bb77b45a1eade0ef8f07c1af39d686a15a774c892ec1124919fb4aace1a3" }, "downloads": -1, "filename": "znbstatic-0.5.tar.gz", "has_sig": false, "md5_digest": "46a699f093745988e35ff76f95d7ad81", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 13345, "upload_time": "2019-07-04T18:44:30", "url": "https://files.pythonhosted.org/packages/bb/96/f5204e1c6655a08532a69e0946ab0e856d40901acb0c183c73fb629eefbe/znbstatic-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a2804fbc6ee88e499473d6d05155439d", "sha256": "716c9c98c2845d1b1f5d0cd29a77700823fe147cee9e20459ad2e28ca4b928ab" }, "downloads": -1, "filename": "znbstatic-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "a2804fbc6ee88e499473d6d05155439d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 14765, "upload_time": "2019-07-04T18:44:29", "url": "https://files.pythonhosted.org/packages/15/bb/d47daa10a5757065a7b5973245dc3606fc8cea3e578ea56d4ac1ca326c14/znbstatic-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46a699f093745988e35ff76f95d7ad81", "sha256": "fae8bb77b45a1eade0ef8f07c1af39d686a15a774c892ec1124919fb4aace1a3" }, "downloads": -1, "filename": "znbstatic-0.5.tar.gz", "has_sig": false, "md5_digest": "46a699f093745988e35ff76f95d7ad81", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 13345, "upload_time": "2019-07-04T18:44:30", "url": "https://files.pythonhosted.org/packages/bb/96/f5204e1c6655a08532a69e0946ab0e856d40901acb0c183c73fb629eefbe/znbstatic-0.5.tar.gz" } ] }