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.
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.