Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Handling POST; independant handlers for different pages
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Asim  
View profile  
 More options Jul 28, 11:03 pm
From: Asim <asim.mit...@gmail.com>
Date: Tue, 28 Jul 2009 20:03:36 -0700 (PDT)
Local: Tues, Jul 28 2009 11:03 pm
Subject: Handling POST; independant handlers for different pages
Hi,

I'm relatively new to web programming and servers. I chose aspen
because i needed something I could setup quickly and get cracking.

I firstly would like to tell you that we really need more
documentation. As a newbie, I'm left quite high and dry with a few
vids and a 24 page pdf. A detailed how to would be nice.

Secondly, I tried writing a simplate (by embedding python code in the
web page). I used the 0x0c character to separate the html and python
content, but nothing seemed to happen. All the python code appeared on
the page like plain text

Thirdly, I want to know if it is possible to write handlers for
different/individual files instead of a whole type of files. Can I
write a handler for index.html and page1.html instead of writing one
common handler for *.html? If it cannot be done, do I have to identify
the file within the handler and make sub cases for each file? When I
write a handler, why must it always return something iterable?

Here's a thing that I want to do to start off. I want to create a page
which uses a form to take in username and password data. The OK button
is then used to post this data to aspen web server. I want to be able
to handle this POST request using a handler or something, and
depending on the authenticity of the data send a "success" or
"failure" page. Is it possible to return a href from the handler to a
page in the local directory, instead of returning a string?

How do i handle post requests? I saw an earlier discussion where Chad
has embedded some py code in the page itself. But as I said, my
browser is treating it as plain text. I have not made any mistakes and
my aspen is installed correctly. I am using the ^L(0x0c) character to
separate the py section from the page html.

Can you please shed light on any of these issues.

Thanks
Asim


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chad Whitacre  
View profile  
 More options Jul 29, 9:40 am
From: Chad Whitacre <c...@zetaweb.com>
Date: Wed, 29 Jul 2009 09:40:48 -0400
Local: Wed, Jul 29 2009 9:40 am
Subject: Re: Handling POST; independant handlers for different pages

Asim,
Thanks for giving Aspen a try. Sorry for the lack of documentation and the
rough edges. I would like to make Aspen more user friendly in the future. Oh
for more hours in a day ...

I would recommend getting simplates to work rather than writing your own
handler. Handlers have to return iterables because they are WSGI callables.
WSGI is a low-level Python web spec that you don't want to mess with as a
newbie.

The problem with simplates (Python code showing up in the browser) sounds
like a wiring problem. Could you post a copy of your handlers.conf file?
Also a copy of the simplate you are working with.

chad


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google