Jquery file browser and django

Does anyone know a tutorial on using jQuery django browser file tree. I followed this guide http://www.abeautifulsite.net/blog/2008/03/jquery-file-tree/ , but I can't get it to work, im messed up with this code block:

    $(document).ready( function() {
            $('#explorer').fileTree({
            root: '/windows/',
             script: 'jqueryFileTree.py',
            expandSpeed: 1000,
            collapseSpeed: 1000,
            multiFolder: True
            }, function(file) {
            alert(file);
    }); 
});

question: in line ==> script: 'jqueryFileTree.py', jqueryFileTree.py in which directory will I put this file?

or maybe I can put the contents of jqueryFileTree.py in my view.py?

+3
source share
2 answers

jqueryFileTree , , , . , div html Explorer.

, , ,

0

django python. "" .

# start your django project
django-admin.py startproject website
# create a first app
django-admin.py startapp explorer

urls.py URL-:

urlpatterns += patterns('',
    (r'^explore$', 'explorer.views.explore'),
)

explorer/views.py:

def explore(request):
   # here you create the view that generates the needed html (look the php examples)
   html = 'Hello, <b>World</b>'
   return HttpResponse()

. .

jQuery '/expl' script.

:)

. ExtJs :)

0

Source: https://habr.com/ru/post/1733303/


All Articles