{ "info": { "author": "KokocGroup", "author_email": "dev@kokoc.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP" ], "description": "django_selectel\n===================\n\n\nThe file store in the [Selectel cloud store](https://selectel.ru/services/cloud/storage/) for Django\n\nStorage and CDN creation\n-------------\n - Log in to your personal [account](https://my.selectel.ru/login/) in\n Selectel. \n - Create a [new user](https://my.selectel.ru/storage/users)\n to work with the store.\n - [Create a new](https://my.selectel.ru/storage/containers) private or public\n container.\n\nInstallation\n-------------\nInstall using `pip`...\n\n pip install django_selectel\n\nIn `settings.py` add the following:\n\n INSTALLED_APPS = (\n\t ...\n\t 'django_selectel',\n\t)\n\nSettings\n-------------------\nAll settings are optional, you can specify them when initializing the storage class\n\n SELECTEL_STORAGE = {\n\t \"USER\": \"\",\n\t \"PASSWORD\": \"\",\n\t \"DOMAINS\": {},\n\t \"OVERWRITE_FILES\": False,\n\t \"USE_GZ\": False,\n\t \"AUTH_URL\": \"https://auth.selcdn.ru/\",\n\t \"API_THRESHOLD\": 30 * 60,\n\t \"API_MAX_RETRY\": 3,\n\t \"API_RETRY_DELAY\": 0.1\n\t}\n\n\t# or\n\n\tfrom django_selectel.storages import ApiStorage\n\n\tcdn_storage = ApiStorage(\n\t\tuser=\"\",\n\t\tpassword=\"\",\n\t\tdomains={},\n\t\tuse_gz=False,\n\t\toverwrite_files=False\n\t)\n\n#### **USER**\nThe username of the storage that is available\n\n#### **PASSWORD**\nPassword from the user\n\n#### **DOMAINS**\n\nAssociate a domain with a specific container. You can bind the domain in the container settings\n\nExample:\n\n \"DOMAINS\": {\n\t \"my_public_container\": \"https://cdn.mysite.com\"\n }\n\n#### **OVERWRITE_FILES**\nAllows you to overwrite files when the name is repeated\n\n#### **USE_GZ**\nFor the storage of files will use the algorithm of compression [Gzip](http://www.gzip.org/zlib/rfc-gzip.html). This will reduce the volume of the container and transmitted traffic\n\n> **Warning:**\n> It is **not recommended for use in public containers**, since the files that will be downloaded directly from the CDN without processing will be in Gzip format\n\n#### **AUTH_URL**\n\nURL to get a token to work with the API\n\n#### **API_THRESHOLD**\n\nIf the token expires less than the specified time (in seconds), it automatically updates\n\n#### **API_MAX_RETRY**\nThe maximum number of attempts to download the file.\nHelps avoid errors when the connection is not stable.\n\n#### **API_RETRY_DELAY**\nDelay in seconds between attempts\n\nUsing\n-------------------\n\nIn `settings.py` add the following:\n\n SELECTEL_STORAGE = {\n\t \"USER\": \"MyUserName\",\n\t \"PASSWORD\": \"MyPassword\",\n\t}\nThe remaining settings can be omitted, because are not required, they will be used as default values if they are not passed as a class parameter\n\nCreate a model with a file field that will work with the cloud-based file system\n\n from django.db import models\n from django_selectel.storages import ApiStorage\n from django.core.files.base import ContentFile\n\n\tclass Image(models.Model):\n\t\t...\n\t\t# for a public container\n\t\tfile = models.FileField(upload_to='my_public_container', storage=ApiStorage()) \n\t\t# for a private container\n\t\tfile = models.FileField(upload_to='my_private_contrainer', storage=ApiStorage(use_gz=True))\n\n\twith open(\"my_image.jpg\") as fh:\n\t\tImage.objects.create(\n\t\t\t...\n\t\t\tfile=fh\n\t\t)\n\timage = Image.objects.first()\n\tprint image.file.read()\n\tprint image.size\n\timage.file.delete()\n\nThe first directory in the upload_to path describes which container the record will be written to. So you can use an unlimited number of containers.\nYou can specify a function that will return the path\n\n from datetime import date\n from django.db import models\n from django_selectel.storages import ApiStorage\n\n def image_upload_to(instance, filename):\n return \"my_container/{:%Y-%m-%d}/{}\".format(date.today(), filename)\n\n\tclass Image(models.Model):\n\t\t...\n\t\tfile = models.FileField(upload_to=image_upload_to, storage=ApiStorage())\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/KokocGroup/django_selectel/tarball/v2.0.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/KokocGroup/django_selectel", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-selectel", "package_url": "https://pypi.org/project/django-selectel/", "platform": "", "project_url": "https://pypi.org/project/django-selectel/", "project_urls": { "Download": "https://github.com/KokocGroup/django_selectel/tarball/v2.0.2", "Homepage": "https://github.com/KokocGroup/django_selectel" }, "release_url": "https://pypi.org/project/django-selectel/2.0.2/", "requires_dist": [ "requests (==2.18.4)" ], "requires_python": "", "summary": "The file store in the Selectel cloud store for Django", "version": "2.0.2" }, "last_serial": 4845998, "releases": { "1.0.12": [ { "comment_text": "", "digests": { "md5": "725edfc4e6c2380cad928bf45a3dff79", "sha256": "548a8861d08247c083ce02f0c652a275da3d29c9c1431376718e65a8cd99ee49" }, "downloads": -1, "filename": "django_selectel-1.0.12.tar.gz", "has_sig": false, "md5_digest": "725edfc4e6c2380cad928bf45a3dff79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4551, "upload_time": "2017-10-27T11:43:14", "url": "https://files.pythonhosted.org/packages/be/6b/ff78ed92cb44ef56c11b960f489c35e5309582f6cd94fa4068bb18c5230c/django_selectel-1.0.12.tar.gz" } ], "1.0.13": [ { "comment_text": "", "digests": { "md5": "17890301978f1a8f213d113d909a548a", "sha256": "966c250163962760711530b17a2a60329588d0d8babd2fb452c133a88604d35e" }, "downloads": -1, "filename": "django_selectel-1.0.13.tar.gz", "has_sig": false, "md5_digest": "17890301978f1a8f213d113d909a548a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4551, "upload_time": "2017-10-27T11:46:10", "url": "https://files.pythonhosted.org/packages/d8/f3/f2041a83eab0762cbd9dabea66d7dfecc8500d190aecff0e546454a3d6aa/django_selectel-1.0.13.tar.gz" } ], "1.0.14": [ { "comment_text": "", "digests": { "md5": "7b70be867758a454bd23fd262b954eeb", "sha256": "36d8686f36f8e8f9e38b5cf7958f0ac84f0a96bfa08e786c07d4e92c8493b642" }, "downloads": -1, "filename": "django_selectel-1.0.14.tar.gz", "has_sig": false, "md5_digest": "7b70be867758a454bd23fd262b954eeb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4578, "upload_time": "2017-10-27T13:36:03", "url": "https://files.pythonhosted.org/packages/f7/0a/87a78ece52a5e6c91f2d4868db08d1623e9fd5602f09cae16c6e5e2fd39f/django_selectel-1.0.14.tar.gz" } ], "1.0.15": [ { "comment_text": "", "digests": { "md5": "5fbe0165189054f609bb86fad36f75aa", "sha256": "c066b312db03b4f9a0bdc3e6b0e1088cc78b96118f302c79609844e0eeada394" }, "downloads": -1, "filename": "django_selectel-1.0.15.tar.gz", "has_sig": false, "md5_digest": "5fbe0165189054f609bb86fad36f75aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6553, "upload_time": "2017-10-27T16:31:25", "url": "https://files.pythonhosted.org/packages/82/aa/9ae419f50077dbf16dba437f4bfe24cfdc9c8c6481494574c0154c2303e8/django_selectel-1.0.15.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "ac32d947f648d334be257f9afbcc9847", "sha256": "0c2be20a2f1b84d952ad84663a5149a6add824957bed98280555465110f7040c" }, "downloads": -1, "filename": "django_selectel-1.0.7.tar.gz", "has_sig": false, "md5_digest": "ac32d947f648d334be257f9afbcc9847", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4597, "upload_time": "2017-10-27T11:14:38", "url": "https://files.pythonhosted.org/packages/49/39/a21965131b81cb5481b4185b92b0c90b47ac5c68c54cdc4b4c256a06dd46/django_selectel-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "7c0d561b80c74e5422fb1ce42965e8ed", "sha256": "0de8b73673401e3bcb61289cb9fee88a46bc4fd66f4efe2774917c39b617d6e9" }, "downloads": -1, "filename": "django_selectel-1.0.8.tar.gz", "has_sig": false, "md5_digest": "7c0d561b80c74e5422fb1ce42965e8ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4588, "upload_time": "2017-10-27T11:20:02", "url": "https://files.pythonhosted.org/packages/81/7f/b14272162db9294db98bcbe6938e279b8c84a3dcee6581d1fe3dee6c8a67/django_selectel-1.0.8.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "256b7d6636e7ddc8d0b6295c0e3f9683", "sha256": "e7e45771e114c3cb0f1c6749d4afcd7b9efb326d41f22ba116ae9a15d8ff5905" }, "downloads": -1, "filename": "django_selectel-1.1.0.tar.gz", "has_sig": false, "md5_digest": "256b7d6636e7ddc8d0b6295c0e3f9683", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6603, "upload_time": "2017-10-27T16:36:56", "url": "https://files.pythonhosted.org/packages/b9/fa/f135cabc259d643c700ad694665ecdbff6b0f45f3bd5b6b70d88a2c5d426/django_selectel-1.1.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "c99e19f3eb9a8d624c2ba908ad2e0fa8", "sha256": "9ba836564ac222256ad9b37640a141a1cbb0cd791921c31df93b46e10c80b47d" }, "downloads": -1, "filename": "django_selectel-2.0.0.tar.gz", "has_sig": false, "md5_digest": "c99e19f3eb9a8d624c2ba908ad2e0fa8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6515, "upload_time": "2019-02-18T10:47:40", "url": "https://files.pythonhosted.org/packages/31/86/821b8c121ed927bd56a95d4a82e8c383427318e31725cf0dd4202b9d22cb/django_selectel-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "23f32e6ab341d17cb6b19edf6c5c6c2d", "sha256": "20772a6345168a6b2f675254d546964f0f7f6a3e7c76120ffd6b39eb158e363d" }, "downloads": -1, "filename": "django_selectel-2.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "23f32e6ab341d17cb6b19edf6c5c6c2d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7908, "upload_time": "2019-02-20T14:45:01", "url": "https://files.pythonhosted.org/packages/71/b1/4c20063652d1e55875cfcef7666e1922adb814e9ed33e52db46d9d2bcfde/django_selectel-2.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "26eb655a8e050a1b58cb3fd8cddda8a4", "sha256": "2652ee66a0a19dad2c6aef1b88bb92d25e64bbfbecadecac5ca63d136ebe60db" }, "downloads": -1, "filename": "django_selectel-2.0.1.tar.gz", "has_sig": false, "md5_digest": "26eb655a8e050a1b58cb3fd8cddda8a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6593, "upload_time": "2019-02-20T14:45:04", "url": "https://files.pythonhosted.org/packages/e2/89/87dd719c6e309b6ee40aaa965b1910a3023d483f226d1852da15e5aaf10e/django_selectel-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "58b95853609f69c9684f3fe728413744", "sha256": "52e56bc055e3d8d258397958e235b240269fc6bc75a93002fc15b2be62dd0de8" }, "downloads": -1, "filename": "django_selectel-2.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "58b95853609f69c9684f3fe728413744", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7920, "upload_time": "2019-02-20T15:09:21", "url": "https://files.pythonhosted.org/packages/11/b0/a340035035f17cceb206c5f625a74fb334f1d141b8eb4c0cbb01eed814ff/django_selectel-2.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b385864c9448788d8e3adef87eeb727", "sha256": "f567230b84aa9793207d1fd7073cded6f141c20cb06d9e07f405b914baa0ed68" }, "downloads": -1, "filename": "django_selectel-2.0.2.tar.gz", "has_sig": false, "md5_digest": "5b385864c9448788d8e3adef87eeb727", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6586, "upload_time": "2019-02-20T15:09:23", "url": "https://files.pythonhosted.org/packages/ce/47/f3a648249e55b8b5109185147a5269c9a7e0ce85ea614a3ea91cadfe43b2/django_selectel-2.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "58b95853609f69c9684f3fe728413744", "sha256": "52e56bc055e3d8d258397958e235b240269fc6bc75a93002fc15b2be62dd0de8" }, "downloads": -1, "filename": "django_selectel-2.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "58b95853609f69c9684f3fe728413744", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7920, "upload_time": "2019-02-20T15:09:21", "url": "https://files.pythonhosted.org/packages/11/b0/a340035035f17cceb206c5f625a74fb334f1d141b8eb4c0cbb01eed814ff/django_selectel-2.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b385864c9448788d8e3adef87eeb727", "sha256": "f567230b84aa9793207d1fd7073cded6f141c20cb06d9e07f405b914baa0ed68" }, "downloads": -1, "filename": "django_selectel-2.0.2.tar.gz", "has_sig": false, "md5_digest": "5b385864c9448788d8e3adef87eeb727", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6586, "upload_time": "2019-02-20T15:09:23", "url": "https://files.pythonhosted.org/packages/ce/47/f3a648249e55b8b5109185147a5269c9a7e0ce85ea614a3ea91cadfe43b2/django_selectel-2.0.2.tar.gz" } ] }