On 5/4/07, drag sidious <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-05-04 at 12:27 -0700, Mike Orr wrote:
> > On 5/3/07, drag sidious <[EMAIL PROTECTED]> wrote:
> > > I realy have no clue what I am doing. All this python web stuff is very
> > > confusing and mystifying. It took me a few days of mucking around before
> > > I found paste and I am just trying to get it working so that I can start
> > > to play around with it.. but I can't even seem to do that.
> >
> > What is your goal?  If you're fascinated by good modular tools and
> > want to build a site with a minimal framework, Paste is worth
> > learning.  But if you just want to get a website built without hassle,
> > Pylons, Django, or TurboGears would be better bets.  Pylons is built
> > on top of Paste but handles the higher-level stuff needed by most
> > applications, which in pure Paste you'd have to write yourself.
> >
>
>
> That's about right. It's a excersize to learn some more about python and
> the web. So I set myself up a bizzare little goal to try to accomplish.

It's good seeing somebody willing to experiment to learn.  I have a
feeling you'll discover the same things others have found, which
they'd be happy to tell you if you ask, but the knowledge you'll gain
by poking around yourself is invaluable; you'll have a feel of the
various libraries and their applicability and limitations.

> I started with PHP. mod_php and Apache was very easy to setup and run. I
> can see why it's so popular, it's very easy to get good results with a
> minimum of effort. But PHP itself kinda sucks, which I wouldn't mind
> except for all the security issues surrounding it. Plus I just like
> python. I decided that PHP istelf is probably just to limited for my
> tastes. I want to learn about more then just web programming.

Many of us have come to Python after looking in horror at some PHP
programs we had to maintain.  *Cough*, PHPNuke.  Fortunately the PHP
documentation has become much better about how to write a secure
scalable program, and the language has added features to help with
this.  Unfortunately you have to ignore a large amount of code
examples and libraries that were not written this way.  Python and its
libraries put more constraints on what you can do, which encourages
better programming.

> So I figured further that databases are over-used for web stuff. Just
> small stuff, mind you. I can see how they would be invaluable for
> anything large and highly interactive.

A SQL database is not the answer for every application.  Object
databases, flat files (e.g., email format), XML files, pickles, CSV
files, and cookies each have their advantages in certain situations.

    SQL: extensive query support, optimized for large datasets and
high concurrency, accessible outside Python.
    Object (Durus, Zope): easy to model nested collections, avoids SQL
and complicated ORM mappers.
    Text (email format, ConfigParser/INI format): can be hand edited
with a small learning curve.  Will always be readable even if the
parser breaks or becomes obsolete.
    XML: similar to text but can describe more complex relations.
Wide support in most programming languages and operating systems.
Visual editors available on many platforms.
    Pickle: very easy to create and load.  Fastest to load (?).
    CSV: good for append-only situations like logging.  Can be
browsed/created in any spreadsheet program.  The grid structure maps
naturally to rows/columns in a table.
    Cookies: if you only need to store small bits of user-specific
data, cookies can eliminate the need for database or sessions.
However, it's inadequate for essential data because users change
browsers, browsers break, and users can delete all cookies without
realizing how it will affect your application.

> I also discovered restructured text as a sorta-structured text and how
> that is based on normal text communication conventions and how it can be
> turned into pdf or html or whatnot.

ReStructured Text is good for that.  It doesn't yet scale to
multi-chapter books, but it's good for articles that can fit into a
single source file.  I hope the wikis will come closer to using it by
default rather than each having its own different language.

> So I figure I can make something fairly small were I can set up a
> directory on the web server, throw a text file into there, and then I
> could have the web browser point to filename.html and it will generate a
> html file to that directory using that text file and they just send that
> to my browser. Or I could point the browser at filename.txt and get the
> text version, or point the browser at filename.pdf and get the pdf
> version. Then if I want to update the webpage I delete the
> html/pdf/whatever and copy back over the updated text file.

That would be a good use case for ReStructured Text.  It's not an
especially common need in dynamic web applications, however, because
usually they're displaying a small pageful of individualized text at a
time.  But an article-oriented site like a CMS would find it useful.

> I did a cursory look at the various frameworks and such and I figure
> they are too complex for me right now.

For your particular case, yes.  For the majority of web application
developers who prefer higher-level tools, the complexity is worth it.

> I figure for now I won't bother with the SCGI stuff. I'll look at it
> some more to see if there is a bug with flup stuff or whatever, but I
> figure the best approach for me right now is to stick with the paste
> http server and if I ever end up needing more performance for whatever
> reason then I can stick a Apache proxy in front it of or figure out the
> scgi stuff.

Right, SCGI is merely a deployment alternative.

-- 
Mike Orr <[EMAIL PROTECTED]>

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to