Giter Club home page Giter Club logo

Comments (20)

specialunderwear avatar specialunderwear commented on July 29, 2024 2

Well, for example if you want to use file browser without grappelli?

from django-filebrowser.

jjanssen avatar jjanssen commented on July 29, 2024 2

I have to agree with Special Underwear. Filebrowser has great functionalities which is a core requirement to all my projects.
Why make a package depend on a "A jazzy skin for the Django Admin-Interface"?
In what way does it enhance the Filebrowser functionality any different from the regular Django Admin-Interface?

from django-filebrowser.

specialunderwear avatar specialunderwear commented on July 29, 2024 1

Ofcourse someone has already done it. https://github.com/wardi/django-filebrowser-no-grappelli That is the one I use most of the time. For requirements management is is better to use official releases from pypi instead of github hashes. The question is therefore, could you make the no grapelli the default on pypi and move the grapelli specific code to grapelli itself?

from django-filebrowser.

leogout avatar leogout commented on July 29, 2024 1

I know it is a very old issue, but I found it when searching for a solution to upload files in a TinyMCE editor with django. I did not wanted to use grapelli as well as the others but all the forks of this project which remove it are dead by now.

Here is an alternative for anyone stumbling upon this issue looking for the same thing as me: https://django-ckeditor.readthedocs.io/
It replaces TinyMCE entirely and adds a file browsing tool which woks nicely out of the box.

By the way, even though I will not use it, thank you for open-sourcing your project @sehmaschine. People often overlook the fact that this is all free and that maybe you are not here to answer their needs.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

no!

from django-filebrowser.

specialunderwear avatar specialunderwear commented on July 29, 2024

Please?

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

are you kidding? why should we?

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

since you´re obviously not able to make your point I´m going to ignore this.

from django-filebrowser.

specialunderwear avatar specialunderwear commented on July 29, 2024

Also it is now hard to use file browser on projects that already have a custom admin skin.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

point is, if we remove the grappelli-dependency, we need to make 2 different versions of the filbrowser (one for grappelli and one for the vanilla admin). since we´re doing this in our spare time, this is just to much effort for us. it might be different in other countries, but here we´re just not able to give the original admin-interface to a customer because of the look & feel. that´s why this dependency definitely (!) won´t be removed (of course, it will be removed once grappelli is obsolete).

from django-filebrowser.

pvanderlinden avatar pvanderlinden commented on July 29, 2024

I think it would be a very nice option. There are many skins for the Django admin, so to force a user of a Django app to use one of those would not be right.

There will also be a conflict when 2 Django apps requires 2 different admin-skins.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

@pvanderlinden: hmm, I don´t know of another django admin skin. maybe admin-tools, but that´s not a skin but a dashboard-utility.

besides, it´s easy to fork the filebrowser. it´s open-source. if really so much people need the filebrowser for the original admin-interface, it shouldn´t be a problem to add a no-grappelli-fork and maintain that fork.

from django-filebrowser.

specialunderwear avatar specialunderwear commented on July 29, 2024

Can you not just add the templates for file browser that involve grapelli into grapelli and keep vanilla templates in file browser? Tat way the templates are overridden if grapelli is used and they are vanilla if they are not used.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

of course we could, but honestly ... can you tell me why we should do that (again, in our spare time) when we don´t use the vanilla theme? other question: why don´t you do it?

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

I can´t believe you´re seriously asking that question.

from django-filebrowser.

marconius avatar marconius commented on July 29, 2024

This thread is hilarious. Good thing I checked the closed issues before making this same suggestion. I agree with removing Grappelli-dependency, because Django allows the use of any third party or custom admin backend, so I don't think it is good practice for any app to remove that ability. BUT I also strongly agree with sehmaschine that if you don't like it, fork it.

from django-filebrowser.

marltu avatar marltu commented on July 29, 2024

Why not make grapelli an optional dependency, if grapelli is registered in INSTALLED_APPS, use it, if not - do not use it.

It would be great for everyone.

from django-filebrowser.

btoueg avatar btoueg commented on July 29, 2024

filebrowser is wonderful but not worth the drawback of grappelli which breaks my admin views. Unfortunately https://github.com/wardi/django-filebrowser-no-grappelli does not work with Python 3 and Django 1.6.

Here is a hybrid solution in 2 steps for having filebrowser without grappelli:

Installing grappelli and filebrowser after django.contrib.admin.

INSTALLED_APPS = (
...
    'django.contrib.admin',
    'grappelli',
    'filebrowser',
...
)

Hacking filebrowser in the urls.py.

from filebrowser import sites

# ==========================================
# = hack for filebrowser without grappelli =
# ==========================================
from django.contrib.admin.views.decorators import staff_member_required
from django.views.decorators.cache import never_cache
from functools import wraps

import filebrowser
import grappelli

def my_decorator(view_func):

    @wraps(view_func)
    def decorator(request, *args, **kwargs):
        from django.template import loader
        from copy import copy

        find_template_bck = copy(loader.find_template)
        def find_template(name, dirs=None):
            dirs = (
                grappelli.__path__[0]+'/templates/',
                filebrowser.__path__[0]+'/templates/',
            )
            return find_template_bck(name,dirs)

        loader.find_template = find_template
        response = view_func(request, *args, **kwargs)
        loader.find_template = find_template_bck
        return response
    return decorator

def my_filebrowser_view(view):
    return my_decorator(staff_member_required(never_cache(view)))

sites.filebrowser_view = my_filebrowser_view
# =================================================
# = end of hack for filebrowser without grappelli =
# =================================================

urlpatterns += patterns('',
    url(r'^grappelli/', include('grappelli.urls')),
    url(r'^admin/filebrowser/', include(sites.site.urls)),
)

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

if grappelli breaks your views (which should not happen), you might wanna open another ticket with grappelli.

from django-filebrowser.

smacker avatar smacker commented on July 29, 2024

Wardi's fork looks outdated. But there a lot others. Mine, for example, that I maintain for about 2 years. https://github.com/smacker/django-filebrowser-no-grappelli

from django-filebrowser.

Related Issues (20)

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.