flask

The Python micro framework for building web applications.

Subscribe to updates I use flask


Statistics on flask

Number of watchers on Github 34143
Number of open issues 25
Average time to close an issue 5 days
Main language Python
Average time to merge a PR 3 days
Open pull requests 87+
Closed pull requests 119+
Last commit 6 months ago
Repo Created over 8 years ago
Repo Last Updated 6 months ago
Size 5.86 MB
Homepage https://www.palle...
Organization / Authorpallets
Contributors297
Page Updated
Do you use flask? Leave a review!
View open issues (25)
View flask activity
View on github
Latest Open Source Launches
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating flask for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Flask

Flask is a lightweight WSGI_ web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple wrapper around Werkzeug_ and Jinja_ and has become one of the most popular Python web application frameworks.

Flask offers suggestions, but doesn't enforce any dependencies or project layout. It is up to the developer to choose the tools and libraries they want to use. There are many extensions provided by the community that make adding new functionality easy.

Installing

Install and update using pip_:

.. code-block:: text

pip install -U Flask

A Simple Example

.. code-block:: python

from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello, World!'

.. code-block:: text

$ FLASK_APP=hello.py flask run
 * Serving Flask app "hello"
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Links

  • Website: https://www.palletsprojects.com/p/flask/
  • Documentation: http://flask.pocoo.org/docs/
  • Releases: https://pypi.org/project/Flask/
  • Code: https://github.com/pallets/flask
  • Issue tracker: https://github.com/pallets/flask/issues
  • Test status:

    • Linux, Mac: https://travis-ci.org/pallets/flask
    • Windows: https://ci.appveyor.com/project/pallets/flask
  • Test coverage: https://codecov.io/gh/pallets/flask

.. _WSGI: https://wsgi.readthedocs.io .. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/ .. _Jinja: https://www.palletsprojects.com/p/jinja/ .. _pip: https://pip.pypa.io/en/stable/quickstart/

flask open issues Ask a question     (View All Issues)
  • almost 2 years Adding documentation on best practices for Server-sent events and WebSockets
  • almost 2 years The file/path provided (flaskr) does not appear to exist.
  • almost 2 years MethodView requires settings "methods" attribute
  • almost 2 years failing test for safe_join in windows
  • about 2 years Support same-site cookies
  • about 2 years Update app factory docs for Flask's CLI
  • about 2 years How should logging in Flask look like?
  • about 2 years Prevent setting `SERVER_NAME` and `SESSION_COOKIE_DOMAIN` to an IP address
  • about 2 years Proposal : splitting the config logic into a different package.
  • about 2 years No response and No exception traceback when render_template failed and DEBUG=True
  • about 2 years Setting items on `response.header` with bytestrings results in new headers in Python 3
  • about 2 years flask app bundle with py2exe issue (AttributeError: function 'PyObject_GetBuffer' not found)
  • about 2 years Documentation for Flask + mod_wsgi + pyvenv + Python 3 doesn't work
  • about 2 years blueprint error handler not working??
  • about 2 years Next/Back Buttons in Documentation
  • over 2 years Document option to use simplejson
  • over 2 years Wrong import json library
  • over 2 years TaggedJSONSerializer does not preserve int keys in dicts
  • over 2 years Jinja templates do not auto reload if Flask app debug enabled solely via app.run(debug=True)
  • over 2 years jsonify no longer causes Content-Length to be set on returned Response object
  • over 2 years Remove version info from Werkzeug in the docs
  • over 2 years Issue using Flask CLI with module layout recommended in Large Applications
  • over 2 years Flask==0.11.0 raises Exception when setting error handlers
  • over 2 years Failing test: test_egg_installed_paths
  • over 2 years "[Errno 2] No such file or directory" on flask run with FLASK_DEBUG=1
  • over 2 years Consider making StrictUndefined the default in Flask 1.0
  • over 2 years flask.Flask.register_blueprint is poorly documented
  • over 2 years [RFC] template load performance, Blueprint.render_template
  • over 2 years Not possible to set a session cookie without a domain attribute when SERVER_NAME is set
  • over 2 years send_file() function tries to get the file from filesystem even if file-like object is passed
flask open pull requests (View All Pulls)
  • Add two missing converters for flask in the docs
  • Fixed stream_with_context not working when decorated function takes parameters
  • Fix for #1740
  • make safe_join behave like os.path.join with *args
  • Add IPython support to flask shell
  • Add JSONIFY_MIMETYPE configuration variable
  • Fix PEP8 issues and enforce PEP8 via pytest-pep8 (i.e. also during CI)
  • Clarified the docstring in method Flask.preprocess_request.
  • Refactored method Flask.make_response to improve readability
  • minor revision of documentation.
  • Extend documentation about uwsgi/nginx deployment
  • Allow to specify subdomain and/or url_scheme in app.test_request_cont…
  • Added session regenerate/destroy methods
  • url_for with alternating schemes
  • Warn when using development server
  • Documentation: Clarify instructions about changing row_factory for SQLite3
  • Url conflict assert
  • Fix static route when using host_matching = True
  • Moved open_session call from RequestContext.push to wsgi_app
  • use blueprint specified template folder
  • Support argument-less factory functions in CLI
  • Add kwarg to disable auto OPTIONS on add_url_rule
  • Deprecate flask.ext
  • Code fix for issue #1481
  • Move object_hook outside loads method so class can be extend and reused
  • Call out that teardown functions must never raise
  • [WIP] Built in routes command
  • JSON support for test client and response object
  • Fix errorhandler HTTPException normalization
  • Add note to not use plain text passwords to views.rst
  • update docs and refer to setuptools
  • Call out that teardown functions must never raise
  • Conditionally install default logging handlers
  • Update MethodViewType for supporting Mixin
  • Updating extension guidelines v2
  • Rewrite docs for context locals, request contexts, and app contexts
  • Set DEBUG and TESTING config value to default to None, not False.
  • Append `Vary: Cookies` header to response when session is accessed
  • Fast path for disabled template load explain.
  • Resolve state issue for url_for with forced scheme
  • Demonstrate how to add multiple urls to the same function endpoint #981
  • Per blueprint jsoncoding #1710
  • Added make target for test coverage, simplified contributing doc
  • sessions documentation (client side vs server side) #434
  • enumerates the states in which code is executed...
  • Enhance code coverage for Blueprint.endpoint
  • Add test for get_version (CLI)
  • Enhance tests.test_cli.test_find_best_app
  • Comment out old version added and changed tags. Fix #1704
  • Remove old version added and changed tags #1704
  • url_for now supports no request context and no SERVER_NAME case
  • Werkzeug mentions
  • Guard sys.exc_clear call for people using pypy3
  • Converts example/flaskr to have a setup.py
  • Update installation documentation for using 'pip' command
  • Enable template auto-reloading in app.run()
  • adding in try around __import__ to catch invalid files/paths
  • Added 127.0.0.0/8 to the session cookie 'localhost' exception.
  • clarify blueprint 404 error handling in docs
  • Check for empty request data prior to loading JSON, fix for #1933
  • FLASK_APP should be set to [app].py, not just [app]
  • Add the ability to combine MethodViews
  • Helper method send_file not closing file handle.
  • Default environ
  • Add license_file to setup.cfg metadata
  • Add scheme to url_build error handler parameters
  • JSON request/response mixin
  • Added a missing module to import statement
  • Parameterizing test
  • Windows.safejoin.issue2033
  • Updated Celery pattern
  • Add possible overriding of builtin cli cmds
  • Ignore cache on request.get_json(cache=False) call
  • Add link to AWS EB Flask tutorial
  • Error handler support for generic HttpException
  • switch to packaged sphinx theme
  • Mention existence of register_error_handler in errorpages.rst
  • use dict instead of if/else logic
  • Add routes command to flask cli
  • update send_file cache control timeout=-1 no-cache
  • Add blueprint and the app factory pattern into the flaskr example
  • Add support for custom console-scripts
  • Allow default Errorhandler for HTTPException
  • Require opt-in for subdomain matching
  • Add re.sub for blueprint add_url_rule handler, prevent '/a//b/'(blueprint.url_prefix='/a/' and the route is '/b/') happened
  • Fix the bug of cache function in `get_json` method.
  • Add tips for 413 connection reset issue
flask questions on Stackoverflow (View All Questions)
  • Starting Background Daemon in Flask App
  • Error displaying a variable from Flask into javascript code
  • Can I run Flask from the interactive shell? If so, how?
  • Flask view methods and SRP
  • Sending data from HTML form to a Python script in Flask
  • Getting 'gevent.hub.LoopExit: This operation would block forever' while combining python3.4, flask and gevent
  • Flask-Restful-Swagger Model class with List field
  • Polymer retrieving list from Flask
  • What would be a simple example of a text interface webpage in Flask?
  • Reflecting tables with Flask-SQLAlchemy raises RuntimeError: application not registered
  • Flask user auth with Spring Security
  • How can I avoid Flask-Admin 2.1 warning "UserWarning: Fields missing from ruleset"?
  • How can messages be retained in a Flask website?
  • flask sqlalchemy paginate() function does not get the same elements when run twice
  • Flask webservice won't receive external message
  • flask/sqlalchemy unittest OperationalError: (sqlite3.OperationalError) no such table, but was able to query table previously
  • 405 method not allowed in flask
  • Multiple forms in a single page using flask and WTForms
  • Nested Blueprints in Flask?
  • Python - flask - understanding behaviour of routing / flash()
  • How to set classes in Flask session, Internal Server Error
  • How do I use Gunicorn for Flask application
  • Dealing with authenticated vs. authorized users with Flask-Login
  • Python Flask: Respond to forms
  • Check for a cookie with Python Flask
  • How do I handle login in flask with multiple blueprints?
  • Unable to insert in postgresql database because flask site accessed record
  • render_template in Flask showing up in JavaScript console not browser
  • How to integrate Geolocation in a flask web app
  • Dynamically change Javascript with Flask
flask list of languages used
Other projects in Python