Useful reference!

Joe Codeswell - Notes to Myself and Others

URL Mapping from the Book Chapter 4 – Dispatching. These are the basics there’s more detail in the book.

The URL    http://site.com/a/c/f    maps to:

The function f() in controller “c.py” in application “a“.

  • If f is not present, web2py defaults to the index controller function.
  • If c is not present, web2py defaults to the default.py controller.
  • If a is not present, web2py defaults to the init application.
  • If there is no init application, web2py tries to run the welcome application.
  • The extension .html is optional.
  • The extension .html is assumed as default.
  • The extension determines the extension of the view that renders the output of the controller function f().
  • The extension allows the same content to be served in multiple formats (html, xml, json, rss, etc.).

Web2py maps GET/POST requests of the form:

http://site.com/a/c/

View original post 100 more words

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s