diff --git a/README.md b/README.md index 4fe1f1a..935966b 100755 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ Media browser for Django. Setup ----- +By default mediabrowser uses [easy-thumbnails](https://github.com/SmileyChris/easy-thumbnails) +for crating image thumbnails. Unless you plan to use your own thumbnailing tool you need to +install easy-thumbnails too. + In settings.py: ```python @@ -23,7 +27,7 @@ MEDIABROWSER_UPLOAD_TO = "mb/%Y/%m" MEDIABROWSER_PAGE_SELECTOR_URL = "my-cms-url-content-selector-name" # Function for user access to mediabrowser -# (defaults is user.is_staff) +# (defaults to user.is_staff) MEDIABROWSER_USER_PASSES_TEST = lambda user:user.is_authenticated ``` @@ -43,7 +47,8 @@ After having added ```mediabrowser``` to ```INSTALLED_APPS``` run ```./manage.py Controlling mediabrowser access ------------------------------- -By default media browser access is allowed for any authenticated user. If this is not +By default media browser access is allowed for any authenticated stuff user +(i.e., ```user.is_stuff == True```). If this is not what you need you could do one of the following: * Set ```MEDIABROWSER_USER_PASSES_TEST```. It should be a callable that takes user object as argument @@ -60,25 +65,25 @@ to link to, do the following: * Define your own view listing content. * Set ```MEDIABROWSER_PAGE_SELECTOR_URL``` to url name of this view. * Make your view's template inherit from ```mediabrowser/base.html```. -(Required context variables: asset_type=doc, page_selector_url=) +(Required context variables: asset_type=doc, page_selector_url=*your_url*) -Subclass ```mediabrowser.views.BaseAssetListView``` or create your own view with -the following to template context: +You CMS integration view can be created by subclassing +```mediabrowser.views.BaseAssetListView```. But you can also create your view from scratch. +Just pass the following context to the template: ```python context = { - # media browser needs to retain original query string set by the editor: + # mediabrowser needs to retain original query string set by the editor: 'QUERY_STRING': self.request.GET.urlencode(), - # set asset_type to doc to use mediabrowser in link mode (as apposed to image insertion mode), + # set asset_type to doc to use mediabrowser in link mode + # (as apposed to image insertion mode), # otherwise "Browse documents" and "Browse content" tabs won't appear: "asset_type": "doc", # Editor needs to know your page_selector_url, otherwise it will not display the # "Browse content" tab: "page_selector_url": settings.MEDIABROWSER_PAGE_SELECTOR_URL - - 'QUERY_STRING': request.GET.urlencode(), } ```