{ "info": { "author": "Sergiy Kuzmenko", "author_email": "sergiy@kuzmenko.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Plugins", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Multimedia", "Topic :: Multimedia :: Graphics" ], "description": "Media browser for Django.\n\n# Setup\n\n\nBy default mediabrowser uses [easy-thumbnails](https://github.com/SmileyChris/easy-thumbnails)\nfor creating image thumbnails.\n\nIn settings.py:\n\n```python\n# add mediabrowser to INSTALLED_APPS:\nINSTALLED_APPS = (\n ...\n 'easy_thumbnails',\n 'mediabrowser',\n ...\n)\n\n# Optional settings:\n\n# Where mediabrowser should upload files (default is \"mb/%Y/%m\"):\nMEDIABROWSER_UPLOAD_TO = \"mb/%Y/%m\"\n\n# URL for selecting links in your CMS.\n# If set, this vlaue will be passed to {% url %} template tag:\nMEDIABROWSER_PAGE_SELECTOR_URL = \"my-cms-url-content-selector-name\"\n\n# Function for user access to mediabrowser\n# (defaults to user.is_staff)\nMEDIABROWSER_USER_PASSES_TEST = lambda user:user.is_authenticated\n\n# Require mediabrowser to check user permissions\n# (defaults to False)\nMEDIABROWSER_CHECK_USER_PERMISSIONS = True\n\n# Automatically resize uploaded images to fit within given dimensions\n# (default to None, i.e. no resizing)\nMEDIABROWSER_MAX_IMAGE_SIZE = (800, 400)\n```\n\nIn urls.py:\n```python\nurlpatterns = patterns('',\n ...\n url(r'', include('mediabrowser.urls')),\n ...\n)\n```\n\nAfter having added ```mediabrowser``` to ```INSTALLED_APPS``` run ```./manage.py syncdb```.\n\n\n\n# Controlling mediabrowser access\n\nBy default full media browser access is allowed for any authenticated staff user\n(i.e., ```user.is_staff == True```). You can use the following settings to refine user access\nrules:\n\nSet ```MEDIABROWSER_USER_PASSES_TEST```. It should be a callable that takes user object as argument\nand returns Boolean. It is a single access control option for uploading, browsing and deletion. Example:\n\n```python\nMEDIABROWSER_USER_PASSES_TEST = lambda user: user.has_perm(\"mycms.change_content\")\n```\n\nSet ```MEDIABROWSER_CHECK_USER_PERMISSIONS = True```. This will ensure user must have\nexplicit permissions to delete or add assets.\n\n\n# Integrating your CMS content browser\n\nTo integrate mediabrowser with your custom CMS to be able to select your CMS's content\nto link to, do the following:\n\n* Define your own view listing content.\n* Set ```MEDIABROWSER_PAGE_SELECTOR_URL``` to url name of this view.\n* Make your view's template inherit from ```mediabrowser/base.html```.\n(Required context variables: asset_type=doc, page_selector_url=*your_url*)\n\nYou CMS integration view can be created by subclassing\n```mediabrowser.views.BaseAssetListView```. But you can also create your view from scratch.\nJust pass the following context to the template:\n\n```python\ncontext = {\n # mediabrowser needs to retain original query string set by the editor:\n 'QUERY_STRING': self.request.GET.urlencode(),\n \n # set asset_type to doc to use mediabrowser in link mode\n # (as apposed to image insertion mode),\n # otherwise \"Browse documents\" and \"Browse content\" tabs won't appear:\n \"asset_type\": \"doc\",\n \n # Editor needs to know your page_selector_url, otherwise it will not display the\n # \"Browse content\" tab:\n \"page_selector_url\": settings.MEDIABROWSER_PAGE_SELECTOR_URL\n}\n```\n\n# Customizing appearance\n\nTo override CSS definitions create your own ```mediabrowser/includes/css.html``` and include your own CSS.\n\nBy default mediabrowser uses [easy-thumbnails](https://github.com/SmileyChris/easy-thumbnails). If you\nwould like to use your own thumbnailing engine override ```mediabrowser/includes/asset-listing.html```.\n\n\n\n# WYSIWYG integration\n\n\n## CKEditor\n\nIn Django template:\n\n```html\n\n```\n\nFor details see [CKEditor documentation](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-filebrowserImageBrowseUrl).\n\n## Custom integration\n\n```javascript\nMEDIABROWSER.insertFile = function(asset_url) {\n // handle asset insertion here\n}\n```\n\nThis can be done inside your own ```mediabrowser/includes/head.html``` include file.\n\nNote that you don't need to close editor window from your custom fuction. This will be done\nautomatically after your funciton is executed.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/shelldweller/mediabrowser", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "mediabrowser", "package_url": "https://pypi.org/project/mediabrowser/", "platform": "any", "project_url": "https://pypi.org/project/mediabrowser/", "project_urls": { "Homepage": "https://github.com/shelldweller/mediabrowser" }, "release_url": "https://pypi.org/project/mediabrowser/0.1.6/", "requires_dist": null, "requires_python": "", "summary": "Django media browser for WYSIWYG HTML editor", "version": "0.1.6" }, "last_serial": 2109711, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "83f238f9d762df992ff3ead341cdcd26", "sha256": "9037dface86171fa567d602eb70d9c48cf8185e81368cf0994cad18b2fd802a5" }, "downloads": -1, "filename": "mediabrowser-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "83f238f9d762df992ff3ead341cdcd26", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 225373, "upload_time": "2015-10-16T04:04:03", "url": "https://files.pythonhosted.org/packages/40/5b/f5d961da6fde80ce42da038e57e30977cd5d3c99a20e2ce3d03529ced9fc/mediabrowser-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5032277c14f49681d8258b3e0dd1398b", "sha256": "c873c4cd6bd3192099da5b4872512d9bdeb56ff0b3138edab0eab00449f10f2d" }, "downloads": -1, "filename": "mediabrowser-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5032277c14f49681d8258b3e0dd1398b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 209842, "upload_time": "2015-10-16T04:04:14", "url": "https://files.pythonhosted.org/packages/35/9c/864350e1fe5c0134b32c3c930334333aae2d24dda10108d6781e21109837/mediabrowser-0.1.1.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "a7430a54b26ab958aa7baf3732ba8376", "sha256": "8ad27c93c1c224c83bf6fbe500d22c09e135e4b2f1d02872c04781f5c0a9584a" }, "downloads": -1, "filename": "mediabrowser-0.1.3.tar.gz", "has_sig": false, "md5_digest": "a7430a54b26ab958aa7baf3732ba8376", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 181498, "upload_time": "2015-11-12T00:25:46", "url": "https://files.pythonhosted.org/packages/70/38/4dddc99ddba67bc1df3ce201719329dd5a4e18de5d1cdafa759304a26adc/mediabrowser-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "a24b9e06bb914f4966c8361dbf453d24", "sha256": "3c52bd74ff3930984cb036975d67b96f0fe961a2010ea43deb0955b6099eb9b8" }, "downloads": -1, "filename": "mediabrowser-0.1.4.tar.gz", "has_sig": false, "md5_digest": "a24b9e06bb914f4966c8361dbf453d24", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 181504, "upload_time": "2016-01-26T18:25:31", "url": "https://files.pythonhosted.org/packages/aa/1b/0d4529e0fcc599fb72f2fe8253c240a24a96735298e6d5e710712b9dd423/mediabrowser-0.1.4.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "8c081bd11c579658d0f59897bb63fefa", "sha256": "0bbf1dc5dabfeab36f5b37fd6b7901cc6225e80db0fda592e68b4f49ffa12695" }, "downloads": -1, "filename": "mediabrowser-0.1.6.tar.gz", "has_sig": false, "md5_digest": "8c081bd11c579658d0f59897bb63fefa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 222896, "upload_time": "2016-05-11T02:50:17", "url": "https://files.pythonhosted.org/packages/f5/a6/7fb2a2e6ec012d5bfda3caf5f8e49637772af0686d7623f6366cd4a484e8/mediabrowser-0.1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8c081bd11c579658d0f59897bb63fefa", "sha256": "0bbf1dc5dabfeab36f5b37fd6b7901cc6225e80db0fda592e68b4f49ffa12695" }, "downloads": -1, "filename": "mediabrowser-0.1.6.tar.gz", "has_sig": false, "md5_digest": "8c081bd11c579658d0f59897bb63fefa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 222896, "upload_time": "2016-05-11T02:50:17", "url": "https://files.pythonhosted.org/packages/f5/a6/7fb2a2e6ec012d5bfda3caf5f8e49637772af0686d7623f6366cd4a484e8/mediabrowser-0.1.6.tar.gz" } ] }