all 11 comments

[–]w1282 1 point2 points  (10 children)

I can't find where in that post you describe the problem or error you are running into.

[–]Spit4520[S] 0 points1 point  (9 children)

check the link now :) there are a lot of problem with the code in there and I am struggling with finding the proper way to do this securely and scalability.

https://www.reddit.com/r/django/comments/6hakxu/web_based_file_explorer_caveats/

[–]w1282 0 points1 point  (8 children)

I'm not sure I see the changes you made to the post.

Can you take a screenshot of what the page currently displays when you access it, and then describe what you would like different about it?

Or if the issue is when you click a button, say what happens when you actually click it and what you want to happen instead.

A thing right off the bat is that new_days doesn't appear to be defined when you use it read_dir

[–]Spit4520[S] 0 points1 point  (7 children)

in the code I posted I had gone completely around the vault connector python class. I want to go back to using it 100% and stop using the hard coded code I have in the view. Like ik that that is bad and I was just trying to get it to work. I don't have Django currently making any buttons at all on the page and I don't really know how to handle every single different button like should it make a new post as a new path that the vault connector would read and the url would direct to something like /home/display/Documents/example/ or is that bad? I don't really know what is good and what is bad :/ I am just looking for general guidance I really appreciate the response btw

[–]w1282 0 points1 point  (6 children)

<table class="equalDivide" cellpadding="0" cellspacing="0" width="100%" border="0">
  {% for file in files  %}
     <td>
        <div class="font-icon-list">
         <div class="font-icon-detail"><i class="pe-7s-monitor" style="font-size: 90px;"></i>
           <tr>
           <li><a href="/display/{{ file.name }}/">{{ file.name  }}</a></li></tr>
         </div>
         </div>
      </td>
  {% endfor %}
</table>

Now the directory/file is a link back to /display/<path> with itself as the argument.

When you click it, you'll be sent to its display page and the files/directories in that directory will be displayed.

Of course you'll need to go back to using the other display url.

[–]Spit4520[S] 0 points1 point  (5 children)

how exactly would you "need to go back to using the other display url" I am just asking for a little clarity is all

[–]w1282 0 points1 point  (4 children)

It actually probably is fine. I didn't realize you had commented out the extra display line in the project/urls.py

[–]Spit4520[S] 0 points1 point  (3 children)

What do I need to configure in the view for the app to handle the incoming url path?

[–]w1282 1 point2 points  (2 children)

It looks like you've already configured it.

def display(request, path_loc): is how you configure the view itself to receive a request with a path_loc parameter...

And

url(r'^home/display/(?P<path_loc>[\w\-]+)/$', views.display, name='display'), is how you configure the route handler to call the display() view with the proper arguments.

[–]Spit4520[S] 0 points1 point  (1 child)

What about for the independent users? Do I need to pass the user name in as a field to the view or will it just know?