views.py ======== The views module handles the routing for all recipe viewing and editing related pages. Flask uses decorators to define the routes, and the decorated function handles the POST or GET as applicable. Routing Functions ----------------- .. autoflask:: main:app :endpoints: Session Helper Functions ------------------------ These assist with session handling. Note that since views is a blueprint stored in the views directory (views/views.py), the function prototypes have the format views.views. .. automodule:: views.views :members: session_email, session_fullname, session_user_id | **Example usage** .. code-block:: python user_email = session_email() full_name = session_fullname() user_id = session_user_id() # If we are not logged in (username is None) then redirect the user to login if not (user_email and user_id): flash('Please login to add a new recipe') return flask.redirect(url_for('auth.login'))