GithubHelp home page GithubHelp logo

gregplaysguitar / django-fileman Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 6.0 32 KB

django-fileman adds user-uploaded static files to the django admin (i.e. images, media, documents) and integrates with tinymce

License: Other

Python 65.27% CSS 10.34% JavaScript 5.37% HTML 19.02%
django tinymce django-admin uploads

django-fileman's People

Contributors

gregplaysguitar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-fileman's Issues

django 2.0 support

There is an error inside fileman/views.py on django.core.urlresolvers import reverse

AWS S3 Support

How can I make it work on AWS S3?

This is not an issue, but multi-upload feature would be nice.

path not in POST

Hi,
I'm testing your fileman-app and discovered that the delete and rename is not working.
The last step in the process is a POST-action, but in the view.delete the first line is
path = request.GET.get('path')
so the variable path is empty.
A quick fix for delete is:

def delete(request):
    if request.method == 'POST':
        path = request.POST.get('path')
        is_dir = os.path.isdir(get_full_path(path))
        if is_dir:
            shutil.rmtree(get_full_path(path))
        else:
            os.remove(get_full_path(path))

        msg = '%s was deleted' % path
        messages.add_message(request, messages.INFO, msg)
        return redirect('admin:fileman_upload_changelist')

    path = request.GET.get('path')
    is_dir = os.path.isdir(get_full_path(path))

    if not is_safe_path(path):
        return redirect('admin:fileman_upload_changelist')


    if is_dir:
        delete_results = render_delete_results(read_dir(path, True))
    else:
        delete_results = None

    return render(request, 'fileman/delete.html', {
        'app_label': 'fileman',
        'title': 'Delete',
        'delete_results': delete_results,
        'path': path,
    })

An in the template delete.html:

  <form action="{{ request.path }}" method="POST">
    {% csrf_token %}
    <input type="submit" value="Yes, I'm sure" class="delete-button">
    <input type="hidden" name="path" value="{{ path }}">
    <a class="button cancel-link" onclick="window.history.back(); return false;">
      No, take me back</a>
  </form>

Except of these it is nice app,
Regards, Helge

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.