javascript - How to construct a web file browser? - Stack Overflow

Goal:simple browser app, for navigating files on a web server, in a tree view.Background:Building a

Goal: simple browser app, for navigating files on a web server, in a tree view.

Background: Building a web site as a learning experience, w/ Apache, mod_python, Python code. (No mod_wsgi yet.)

What tools should I learn to write the browser tree? I see JavaScript, Ajax, neither of which I know. Learn them? Grab a JS example from the web and rework? Can such a thing be built in raw HTML? Python I'm advanced beginner but I realize that's server side.

If you were going to build such a toy from scratch, what would you use? What would be the totally easy, cheesy way, the intermediate way, the fully professional way?

No Django yet please -- This is an exercise in learning web programming nuts and bolts.

Goal: simple browser app, for navigating files on a web server, in a tree view.

Background: Building a web site as a learning experience, w/ Apache, mod_python, Python code. (No mod_wsgi yet.)

What tools should I learn to write the browser tree? I see JavaScript, Ajax, neither of which I know. Learn them? Grab a JS example from the web and rework? Can such a thing be built in raw HTML? Python I'm advanced beginner but I realize that's server side.

If you were going to build such a toy from scratch, what would you use? What would be the totally easy, cheesy way, the intermediate way, the fully professional way?

No Django yet please -- This is an exercise in learning web programming nuts and bolts.

Share Improve this question asked Jun 2, 2009 at 20:11 user447688user447688 1
  • mod_wsgi is not as hard as you might believe. – Ionuț G. Stan Commented Jun 2, 2009 at 20:17
Add a ment  | 

4 Answers 4

Reset to default 10

First, switch to mod_wsgi.

Second, write a hello world in Python using mod_wsgi.

Third, change your hello world to show the results of os.listdir().

I think you're approximately done.

As you mess with this, you'll realize that transforming the content you have (information from os.listdir) into presentation in HTML is a pain in the neck.

You can add Jinja templates to this to separate content from presentation.

Finally, you'll notice that you've started to build Django the hard way. Stop. Learn Django. You'll see that it's still "programming nuts and bolts". It doesn't "conceal" or "abstract" much away from the web server development experience. It just saves you from reinventing the wheel.

If you want to make interactive browser, you have to learn JS and ajax.

If you want to build only browser based on links, python would be enough.

The "totally cheesy" way:

python -m SimpleHTTPServer

This will serve up the files in the current directory at http://localhost:8000/

set "Indexes" option to the directory in the apache config.

To learn how to build webapps in python, learn django.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745136888a4613246.html

相关推荐

  • javascript - How to construct a web file browser? - Stack Overflow

    Goal:simple browser app, for navigating files on a web server, in a tree view.Background:Building a

    1小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信