Skip to content

wangwangaze/ECE444-F2020-Lab2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Zhuoer (Annie) Wang

This repo is a clone of https://github.com/miguelgrinberg/flasky
The application source code for lab 2 is located in hello.py

Activity 1: Virtualenv and Flask Installed

Alt text

Activity 2: Example 2-2

Alt text

Activity 3: What are Flask global context variables?

Request Context:

The request context keeps track of the request-level data during a request. Rather than passing the request object to each function, it's globally accessible through request and session.

A Request object called request containing the environment it received from the WSGI server is made for every request. The request data is global during the handling of the request.

A dictionary called session is used by the application to store values that are remembered between requests within a user session.

Application Context:

The application context keeps track of the application-level data during a request, including configurations. Rather than passing the application to each function, it's globally accessible through current_app and g.

The current_app function points to the application instance handling the current activity, it can be used to access data about the running application, including the configuration.

The g object can be used by the application for temporary storage while handling requests. The object is reset for each new request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages