Code Monkey home page Code Monkey logo

django-tinymce-filebrowser's Introduction

django-tinymce-filebrowser

django-tinymce-filebrowser is a simple and flexible tool for managing your files and images from TinyMCE editor.

Current version of package support only TinyMCE 3.x versions.

Quickstart:

Install django-tinymce-filebrowser:

$ pip install django-tinymce-filebrowser

Add tinymce and mce_filebrowser to INSTALLED_APPS in settings.py for your project:

INSTALLED_APPS = (
    ...
    'tinymce',
    'sorl.thumbnail',
    'mce_filebrowser',
)

Note: sorl.thumbnail is required package for correct filebrowser work.

Migrate django-tinymce-filebrowser models

$ python manage.py migrate mce_filebrowser

Change tinymce config to work with filebrowser:

TINYMCE_DEFAULT_CONFIG = {
  'file_browser_callback': 'mce_filebrowser'
}

Add mce_filebrowser.urls to urls.py for your project:

urlpatterns = [
    ...
    url(r'^tinymce/', include('tinymce.urls')),
    url(r'^mce_filebrowser/', include('mce_filebrowser.urls')),
]

In your models.py code:

from django.db import models
from tinymce.models import HTMLField

class MyModel(models.Model):
    ...
    content = HTMLField()

In your admin.py:

from django.contrib import admin
from myapp.models import MyModel
from mce_filebrowser.admin import MCEFilebrowserAdmin

class MyModelAdmin(MCEFilebrowserAdmin):
    pass

admin.site.register(MyModel, MyModelAdmin)

django-tinymce-filebrowser uses django staticfiles.

If You do not use django-tinymce package then add next lines to TinyMCE init:

tinyMCE.init({
    ...
    "file_browser_callback": "mce_filebrowser"
})

Additional settings:

FILEBROWSER_PER_PAGE - files per page in filebrowser

Bitdeli Badge

django-tinymce-filebrowser's People

Contributors

aisayko avatar bitdeli-chef avatar ulisesqg avatar vint21h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

django-tinymce-filebrowser's Issues

Outdated

I really appreciate your work and I thank you for all these years of supporting this library.
I hope from you to continue your work or remove this library whatever you do will be a big help for other developers.
Thank you.

documentation

In the documentation, you should not forget to add 'sorl.thumbnail' to INSTALLED_APPS. Otherwise it won't be possible to load the thumbnails taglib.

Thank you!

Add plugins

How add plugins ? Style, emoticons, text color, print etc ? I search everywhere. But only i can change theme from advanced to simple.

No preview for previously uploaded files.

I somehow cannot see previously uploaded files in the popup and cannot select them for another use.
I checked the filebrowser.html and I see that it iterates through images in object_list but it doesn't render the thumbnail.
Any reasons why can this happen?

pip

pip install Django-tinymce-filebrowser

does not seem to work

use without admin.py

Is it possible to use the filebrowser in the standard text plugin or in a plugin that doesn't use admin.py?

Popup Slowness

What can I do to reduce slowness of popup load? I'm pretty sure that the issue we are running into has something to do with the number of images my client has uploaded. Is it possible we could do pagination on the popup so that it only shows a subset of the images at once?

screen shot 2014-08-08 at 10 22 35 am

File Upload With media

I´m trying to upload media with the 'media' plugin of tinymce. However I get a 404 error when clicking the filebrowser.

tinymce Uncaught TypeError: Cannot call method 'apply' of undefined

Screenshot - 04222013 - 02:01:06 PM
I clone this repo to my django project. Add to list of installed apps 'mce_filebrowser'.
Here is my
TINYMCE_DEFAULT_CONFIG = {
'theme': "advanced",
#'cleanup_on_startup': True,
'custom_undo_redo_levels': 10,
'file_browser_callback': 'mce_filebrowser',
}
Also i change filebrowser.html template to load tinymce js files. Check it, everything is loaded. Currently have no idea what is the problem..

Cannot import mce_filebrowser.urls

I followed your installasion guide, I typed this:
urlpatterns = [
...
url(r'^tinymce/', include('tinymce.urls')),
url(r'^mce_filebrowser/', include('mce_filebrowser.urls')),
]

Then I got error:
.. _env/local/lib/python2.7/site-packages/mce_filebrowser/urls.py", line 4, in
from django.conf.urls import patterns, url
ImportError: cannot import name patterns

How use it not in admin?

I want to use it in my project,but I don't want to use admin.Can you tell me how to use it not in admin?Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.