All Projects → schedutron → Flask Common

schedutron / Flask Common

Licence: apache-2.0
A Flask extension with lots of common time-savers (file-serving, favicons, etc).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Flask Common

Flask Caching
A caching extension for Flask
Stars: ✭ 582 (+156.39%)
Mutual labels:  flask, extension
Fleep Py
File format determination library for Python
Stars: ✭ 222 (-2.2%)
Mutual labels:  extension
Preact Devtools
Browser extension for inspection Preact applications
Stars: ✭ 204 (-10.13%)
Mutual labels:  extension
Sketchup Stl
A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
Stars: ✭ 214 (-5.73%)
Mutual labels:  extension
Ssis Dashboard
HTML5 SQL Server Integration Services Dashboard
Stars: ✭ 206 (-9.25%)
Mutual labels:  flask
Authlib
The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
Stars: ✭ 2,854 (+1157.27%)
Mutual labels:  flask
Code D
Fully featured D language extension for Visual Studio Code using Serve-D
Stars: ✭ 202 (-11.01%)
Mutual labels:  extension
Slapdash
Boilerplate for bootstrapping scalable multi-page Dash applications
Stars: ✭ 225 (-0.88%)
Mutual labels:  flask
Flaskmovie
【正在改版开发中,请勿使用!】Flask电影网站前台+后台管理。
Stars: ✭ 221 (-2.64%)
Mutual labels:  flask
Uwsgi Nginx Flask Docker
Docker image with uWSGI and Nginx for Flask applications in Python running in a single container. Optionally with Alpine Linux.
Stars: ✭ 2,607 (+1048.46%)
Mutual labels:  flask
Scout
RESTful search server written in Python, powered by SQLite.
Stars: ✭ 213 (-6.17%)
Mutual labels:  flask
Saas Base
SaaS base application (Flask, Vue, Bootstrap, Webpack)
Stars: ✭ 208 (-8.37%)
Mutual labels:  flask
Facebook Political Ads
Monitoring Facebook Political Ads
Stars: ✭ 215 (-5.29%)
Mutual labels:  extension
Proxypool
An Efficient ProxyPool with Getter, Tester and Server
Stars: ✭ 3,050 (+1243.61%)
Mutual labels:  flask
Titan
Create Discord server widgets for websites of all sizes! A simple to setup process for end-users. Server members may view or send messages into an embedded Discord channel.
Stars: ✭ 221 (-2.64%)
Mutual labels:  flask
Marshmallow Jsonapi
JSON API 1.0 (https://jsonapi.org/) formatting with marshmallow
Stars: ✭ 203 (-10.57%)
Mutual labels:  flask
Xmark
A PHP7 extension that can hook most functions/classes and parts of opcodes
Stars: ✭ 209 (-7.93%)
Mutual labels:  extension
Eve Sqlalchemy
SQLAlchemy data layer for Eve-powered RESTful APIs
Stars: ✭ 215 (-5.29%)
Mutual labels:  flask
Flask Paginate
Pagination support for flask
Stars: ✭ 223 (-1.76%)
Mutual labels:  flask
Flask Jsonrpc
A basic JSON-RPC implementation for your Flask-powered sites
Stars: ✭ 223 (-1.76%)
Mutual labels:  flask

flask-common

A Flask extension with lots of common time-savers (file-serving, favicons, etc).

An example app:

import time
from flask import Flask
from flask_common import Common

app = Flask(__name__)
app.debug = True

common = Common(app)

@app.route("/")
@common.cache.cached(timeout=50)
def hello():
    time.sleep(1)
    return "Hello World!"


if __name__ == "__main__":
    common.serve()

Next:

  • Put a favicon.ico in your static folder.
  • Enjoy!

Nicities

HTTP Headers:

  • X-Powered-By: Flask.
  • X-Processed-Time: 0.000133037567139.

Other nice things:

  • @common.cache.cached(timeout=50) decorator for caching views in memory.
  • Favicon support (/favicon.ico redirects to /static/favicon.ico).

Web Server: Gunicorn + Meinheld

Automatically uses Gunicorn + Meinheld for production (when Flask.debug = False), Flask's dev server for development.

Configuration environment variables:

  • WEB_CONCURRENCY for specifying the number of synchronous gunicorn workers.
  • PORT for binding to a specific port.

File Server: WhiteNoise

Flask-Common automatically configures WhiteNoise to serve your static files.

Configurations

app.config['COMMON_FILESERVER_DISABLED'] = 1
app.config['COMMON_POWERED_BY_DISABLED'] = 1
app.config['COMMON_PROCESSED_TIME_DISABLED'] = 1

Cache configures

By default simple is a default cache type. But can you change this options, following below steps. Flask-Caching

app.config['COMMON_CACHE_TYPE'] = "simple"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].