Skip to content

Commit

Permalink
add support django 2+
Browse files Browse the repository at this point in the history
  • Loading branch information
jfazpro committed Jul 29, 2019
1 parent 7e9ab5e commit 1cd2c48
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 20 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ At the moment i'm without time to maintain this great project. To all the people

# Changelog

### 08-03-2017 v3.5.2
* Support Django 2+

### 08-03-2017 v3.5.0
* Removed flash uploader. Instead of this added drag’n’drop file uploads with image previews.

Expand Down Expand Up @@ -42,7 +45,7 @@ At the moment i'm without time to maintain this great project. To all the people
## Suit support
The application have support for [django-suit](https://github.com/darklow/django-suit) template. To use it add on your settings files the following config:

<code>FILEBROWSER_SUIT_TEMPLATE = True</code>
<code>FILEBROWSER_SUIT_TEMPLATE = True</code>

Filebrowser will now use templates for django suit.

Expand Down Expand Up @@ -98,7 +101,7 @@ class Editor(ModelForm):
css = {
'all': ('filebrowser/css/suit-filebrowser.css',)
}

class AdminPublication(admin.ModelAdmin):
form = Editor

Expand Down Expand Up @@ -130,7 +133,7 @@ class AdminPublication(admin.ModelAdmin):

admin.site.register(MediaPublication, AdminPublication)
```

The most important things are on ModelForm (Media and Widgets). To use browser on CKEditor and have the button to navigate on filebrowser you only need to add the js file to Media

For Redactor you will have to add the plugin option on the widget (plugin name is mandatory - _filebrowser_ ) and add the css and js file to media.
Expand All @@ -152,10 +155,8 @@ That's it you are now ready to send all kind of files to ckeditor or redactor.

Please this is a work in progress. If you have ideas or want to make it better please fel free to pull requests.

* Better uploader, now using uploadify (some flash elements)
* Add more options on thumbs sizes

### More Info

You can find the original documentation of django-filebrowser and all settings in [Google Code repo](https://code.google.com/p/django-filebrowser/w/list).

Empty file added __init__.py
Empty file.
7 changes: 6 additions & 1 deletion filebrowser/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import django

from django.apps import AppConfig
from django.views.decorators.cache import never_cache
from django.core.urlresolvers import reverse
if django.VERSION[0] < 2:
from django.core.urlresolvers import reverse
else:
from django.urls import reverse
from django.utils.translation import ugettext as _

from filebrowser.conf import fb_settings
Expand Down
Empty file modified filebrowser/static/filebrowser/dropzone/basic.min.css
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions filebrowser/static/filebrowser/dropzone/dropzone-amd-module.min.js
100755 → 100644

Large diffs are not rendered by default.

Empty file modified filebrowser/static/filebrowser/dropzone/dropzone.min.css
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions filebrowser/static/filebrowser/dropzone/dropzone.min.js
100755 → 100644

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions filebrowser/static/filebrowser/jquery/jquery-3.1.1.min.js

This file was deleted.

1 change: 0 additions & 1 deletion filebrowser/static/filebrowser/jquery/jquery-3.1.1.min.map

This file was deleted.

2 changes: 2 additions & 0 deletions filebrowser/static/filebrowser/jquery/jquery-3.4.1.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions filebrowser/static/filebrowser/jquery/jquery-3.4.1.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion filebrowser/templates/filebrowser/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!-- JAVASCRIPTS -->
{% block extrahead %}
{{ block.super }}
<script src="{{ settings_var.URL_FILEBROWSER_MEDIA }}jquery/jquery-3.1.1.min.js"></script>
<script src="{{ settings_var.URL_FILEBROWSER_MEDIA }}jquery/jquery-3.4.1.min.js"></script>
<script src="{{ settings_var.URL_FILEBROWSER_MEDIA }}dropzone/dropzone.min.js"></script>
<script>
Dropzone.autoDiscover = false;
Expand Down
2 changes: 1 addition & 1 deletion filebrowser/templates/suit/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{% block extrahead %}
{{ block.super }}
<script src="{{ settings_var.URL_FILEBROWSER_MEDIA }}jquery/jquery-3.1.1.min.js"></script>
<script src="{{ settings_var.URL_FILEBROWSER_MEDIA }}jquery/jquery-3.4.1.min.js"></script>
<script src="{{ settings_var.URL_FILEBROWSER_MEDIA }}dropzone/dropzone.min.js"></script>
<script>
Dropzone.autoDiscover = false;
Expand Down
7 changes: 5 additions & 2 deletions filebrowser/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import re
import mimetypes

import django
# django imports
from django.shortcuts import render
from django.http import HttpResponseRedirect, Http404, JsonResponse
Expand All @@ -16,7 +16,10 @@
from django.utils.encoding import smart_str
from django.conf import settings
from django import forms
from django.core.urlresolvers import reverse
if django.VERSION[0] < 2:
from django.core.urlresolvers import reverse
else:
from django.urls import reverse
from django.core.exceptions import ImproperlyConfigured
from django.core.files.move import file_move_safe
from django.core.paginator import Paginator, InvalidPage, EmptyPage
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='django-media-manager',
version='3.5.0',
version='3.5.2',
description='Media-Management with the Django Admin-Interface.',
author=['Patrick Kranzlmueller','Six Foot'],
author_email='[email protected]',
Expand Down

0 comments on commit 1cd2c48

Please sign in to comment.