Hello John,

On Tue, Aug 27, 2013 at 9:19 PM, John M <[email protected]> wrote:

> So, doesn't the file extension already indicate how a file should be
> handled?
>


No. Dynamic applications can and frequently do rewrite URLs internally at
will. File extensions can be ignored as well.

This isn't a new feature. All modern web servers have supported this for
some time now. For example, Apache has mod_rewrite (
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html ).


On Tue, Aug 27, 2013 at 9:19 PM, John M <[email protected]> wrote:

> Is it possible to tell the engine to handle .html files as .py files and
> if the content is python will that actually work?
>
>

Sure. You could for example wildcard an entire directory and say that any
requests to that directory are to be handled by a specific script, even if
the end of the URL shows a HTML extension (although you do need to note
that it's a script handler and not a static file in app.yaml).


On Tue, Aug 27, 2013 at 9:19 PM, John M <[email protected]> wrote:

> It seems redundant but that doesn't seem smart so assuming that isn't true
> what don't I understand?
>


Also note that App Engine treats application code (scripts) separately from
static assets. Static assets are hosted separately for fast access by the
client. See
https://developers.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Static_file_handlersfor
more information.


On Tue, Aug 27, 2013 at 9:19 PM, John M <[email protected]> wrote:

> I realize that with app.yaml you can also specify that all graphics (or
> whatever file pattern) are in a certain directory, etc.. but can't you just
> reference that directory in the original call to the graphic from the html?
>


No you can't, because the client's request and the server's interpretation
of the request are two completely different things. The client can request
whatever it wants; the server is entitled to reroute the request as it
feels, or even to refuse the request altogether. The static file, as
served, may be in a completely different location within the application.

For instance, take the classic example of favicon.ico. Here's how most
people map the icon:

*- url: /favicon.ico*
*static_files: static/favicon.ico*
*upload: static/favicon.ico*

So what this says is that there's an icon image located in the folder
/static/. But if the user requests the image, it looks like the image is in
the root folder (which it really isn't if we looked at the application
folder).


-----------------
-Vinny P
Technology & Media Advisor
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to