Routing URLs and accepting requests (Simple)

This section will connect URLs to Python functions in our web service.

Getting ready

Use the project layout listed under the Project Layout section in the Running a Simple Application recipe.

How to do it...

  1. The Flask app object includes a route decorator to specify URL rules to use for a view function conveniently, which provides a declarative style for routing requests to Python callables. The following code routes five URL handling functions for the list, detail, creation, updating, and deletion of appointment records in our scheduling application. For now, we simply return a string describing what the handler is going to do, which we'll implement later, so that you can see the URL routing in action ...

Get Instant Flask Web Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.