Giter Site home page Giter Site logo

flasky's Introduction

Coneptual stuff

Application Contexts current_app, g

Request contexts request, session

Checking app context

app_ctx=app.app_context() app_ctx.push() current_app.name 'hello' app_ctx.pop() current_app.name

Checking URL map

app.url_map Map([<Rule '/static/' (OPTIONS, GET, HEAD) -> static>, <Rule '/' (OPTIONS, GET, HEAD) -> hello>, <Rule '/username/' (OPTIONS, GET, HEAD) -> user>])

<Rule '/static/' (OPTIONS, GET, HEAD) -> static> >>>>> This is a special route added by Flask to access static files.

OPTIONS, GET, HEAD >>>>> These are the request methods

IMPORTANT request hooks

before_request before_first_request after_request teardown_request

IMPORTANT bootstrap template blocks

Available blocks Block name Outer Block Purpose doc Outermost block. html doc Contains the complete content of the tag. html_attribs doc Attributes for the HTML tag. head doc Contains the complete content of the tag. body doc Contains the complete content of the tag. body_attribs body Attributes for the Body Tag. title head Contains the complete content of the <title> tag. styles head Contains all CSS style tags inside head. metas head Contains all tags inside head. navbar body An empty block directly above content. content body Convenience block inside the body. Put stuff here. scripts body Contains all <script> tags at the end of the body.

ref # https://pythonhosted.org/Flask-Bootstrap/basic-usage.html#available-blocks

***** IMP ****** the super() function when called inside a block then it overrides the inherited content with the html pages own content

Custom Error pages

Customize error pages with @app.errorhandler(404) etc.

Web forms

flasky's People

Contributors

rajverma1985 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.