Books
Malhar Lathkar

Building Web Apps with Python and Flask: Learn to Develop and Deploy Responsive RESTful Web Applications Using Flask Framework (English Edition)

  • DDaudalagidhas quoted2 years ago
    Just to recap, a web template engine merges a static web page having place holder variables with a data source to generate multiple web pages.
  • DDaudalagidhas quoted2 years ago
    Note the use of __name__ as argument to the Flask() constructor. You may be aware that __name__ is a module attribute that returns the context in which the Python interpreter is being executed.
  • DDaudalagidhas quoted2 years ago
    Although Flask is a minimalistic framework, other features can be easily added in the application with the help of several Flask extensions. For example, Flask doesn't have any in-built provision for database connectivity, but the Flask-SQLAlchemy extension enables using SQLAlchemy, an object relation mapper with different RDBMS platforms.

    Cita

  • DDaudalagidhas quoted2 years ago
    Flask is essentially a wrapper around two Python packages: Werkzeug – a set of WSGI utilities and Jinja – a web templating engine.
  • DDaudalagidhas quoted2 years ago
    Many web frameworks use the Model-View-Controller (popularly known as MVC) architecture.
  • DDaudalagidhas quoted2 years ago
    The use of a framework facilitates rapid development of scalable and reliable web applications.
  • DDaudalagidhas quoted2 years ago
    Another useful module in wsgiref package is the wsgiref.validate module. The compliance of a WSGI application with WSGI standards can be verified by the validator() function defined in this module.
  • DDaudalagidhas quoted2 years ago
    The start_response() function itself requires a status code string and response headers. The function should return an iterable with response body
  • DDaudalagidhas quoted2 years ago
    The headers argument is a list of (header_name, header_value) tuples. The exc_info argument is optional. If given, it must be a Python sys.exc_info() tuple and must be supplied only if start_response is being called by an error handler.
  • DDaudalagidhas quoted2 years ago
    Upon receiving a request from a client, a WSGI-compliant web server passes it to the application, along with two positional arguments:
    environ: A Python dict object that is similar to CGI environment variables and certain WSGI specific variables. Certain server-specific extension variables may also be included.
    start_response: A callback function to be used by the application to return its response along with headers and status code. HTTP headers expected by the client must be wrapped as a list of tupled pairs. The format of this function is as follows:
    start_response(status, headers, exc_info=None)
fb2epub
Drag & drop your files (not more than 5 at once)