Skip to content
Myr

Improved doc exaples. This fixes #370 and #371.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent a9726c4 · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:docs/quickstart.rst+4 added-4 removed
151 unmodified lines
152153 @app.route('/user/<username>')154 def show_user_profile(username):155 # show the user profile for that user156 pass156 return 'User %s' % username157158 @app.route('/post/<int:post_id>')159 def show_post(post_id):160 # show the post with the given id, the id is an integer161 pass161 return 'Post %d' % post_id162163The following converters exist:164165=========== ===========================================
11 unmodified lines
177 Take these two rules::178179 @app.route('/projects/')180 def projects():181 pass181 return 'The project page'182183 @app.route('/about')184 def about():185 pass185 return 'The about page'186187 They look rather similar, the difference is the trailing slash in the188 URL *definition*. In the first case, the canonical URL for the189 `projects` endpoint has a trailing slash. It's similar to a folder in
635 unmodified lines