GithubHelp home page GithubHelp logo

jinstrive / django-tinymce-filebrowser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aisayko/django-tinymce-filebrowser

0.0 2.0 0.0 1.04 MB

Simple django-based file uploader and viewer for TinyMCE

License: MIT License

Python 64.37% CSS 4.61% JavaScript 1.47% HTML 29.55%

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.

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 = patterns('',
    ...
    (r'^tinymce/', include('tinymce.urls')),
    (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 avakdh avatar bitdeli-chef avatar vint21h avatar

Watchers

 avatar  avatar

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.