A web framework is a so-called library that makes a developer’s life easier when building web applications. Most popular web frameworks encapsulate what developers across the globe have learnt over the past twenty years.

Most of you, when choosing a framework for a web application, firstly think of Django. No doubt, in lots of cases Django, with its everything-out-of-the-box and (killer feature) automatic database generation, is very suitable.

However, let’s take a look around. There is a number of various Python frameworks and, surprisingly, they aren’t clones of Django. Some of them are surely better to choose, or at least worth learning, for some specific usage.

There are more than 25 active Python web framework projects. Projects without stable releases during the last 365 days and web frameworks not supporting Python 3 were left out.

Let’s develop a very simple application with each popular framework. An application must response « Hello world! » to /hello/ request, and also templating must be used to pass « Hello world! » message dynamically. Database access is another important question regarding frameworks, but comparison of that would be too bulky for such brief overview. For API frameworks (Falcon, Hug and Sanic) a response must be {'message': 'Hello world!'}.

The comparison of Python web frameworks includes:

Another Python web frameworks comparison includes:


Github stars: 24627

Github forks: 10044

The main principle of Django ninjas is to develop everything of any complexity IN TIME. It’s originally developed for content-management systems, but its rich features including but not limited to templating, automatic database generation, DB access layer, automatic admin interface generation – are well suitable for other kinds of web applications. Provides a web server for development use. Form serialization and validation, template system with inheritance of templates, caching in several ways, internationalization, serialization to XML or JSON. Django is contributed with applications for maintenance: an authorization system, a dynamic admin system, RSS and Atom generators, Google Sitemaps generator, and so on. Django is used by Instagram, Pinterest, The Washington Times, Disqus, Bitbucket and Mozilla.

When developing a microapplication, Django begins with complexity from the start. After installing the package (Django, literally), you must create a project with « django-admin startproject myproject » command. Then, you should configure the app in myproject/myproject/settings.py – at least database access and templating. Django application is always unified in structure. It’s excellent when you develop many boring applications. My application is:


from django.shortcuts import render

def hello(request):
    return render(request, 'myproject/message.html', {'message': 'Hello world!'})


from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^hello/', views.hello, name='hello'),

Also, there are some obvious changes in myproject/myproject/settings.py and the template in myproject/templates/myproject/message.html.

pip freeze contains: appdirs, Django, packaging, pyparsing, six.

Official website | GitHub page | PyPI page


Github stars: 26078

Github forks: 8283

A microframework for Python based on Werkzeug and Jinja2 « with good intentions ». Being a microframework, Flask is worth using when developing small applications with simple requirements, not like Django, Pyramid, et cetera. For example, you may operate your database in any way you like with Flask – by means of SQLAlchemy or anything else. Use it if you are going to develop a small application and configure everything by yourself. Other features: development web server, integrated unit testing support, Google App Engine compatibility. Flask is used by LinkedIn, Pinterest.

Flask example is very simple.

from flask import Flask, render_template
app = Flask(__name__)

def hello():
    return render_template('message.html', message="Hello world!")

if __name__ == "__main__":

pip freeze contains: appdirs, click, Flask, itsdangerous, Jinja2, MarkupSafe, packaging, pyparsing, six, Werkzeug.

Official website | GitHub page | PyPI page


Github stars: 13190

Github forks: 3972

Its main feature is non-blocking I/O. Thus, Tornado can be scaled to handle tens of thousands of open connections. An ideal framework for long polling, WebSockets and other usages with continuous connection. Tornado officially supports only Linux and BSD OS (Mac OS X and Microsoft Windows are recommended only for development use). The origin of Tornado is FriendFeed project, now owned by Facebook.

The task doesn’t need any of the Tornado’s key features – asynchrony. By the way, simple applications with Tornado are easy.

import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.render('message.html', message='Hello world!')

def make_app():
    return tornado.web.Application([
        (r"/hello", MainHandler),

if __name__ == "__main__":
    app = make_app()

pip freeze lists: appdirs, packaging, pyparsing, six, tornado.

Official website | GitHub page | PyPI page


Github stars: 3821

Github forks: 422

Falcon is a microframework for small applications, app backends and higher-level frameworks. It encourages to follow the REST concept, and thus, you should think of resources and state transitions mapped to HTTP methods when developing with Falcon. Falcon is one of the fastest web frameworks in Python. It’s used by Cronitor, EMC, Hurricane Electric, OpenStack, Opera Software, Wargaming, Rackspace.

Falcon is not suitable for serving HTML pages at all. It is appropriate for RESTful APIs. Here is some code to response for a GET request with a JSON response.

import falcon
import json

class HelloResource:
    def on_get(self, request, response):
        """Handles GET requests"""
        data = {'message': 'Hello world!'}

        response.body = json.dumps(data)

api = falcon.API()
api.add_route('/hello', HelloResource())

As Falcon doesn’t include a server, Waitress is suitable as one. waitress-serve --port=8080 app:api

The response for http://localhost:8080/hello is simple {"message": "Hello world!"}

pip freeze contains: appdirs, falcon, packaging, pyparsing, python-mimeparse, six, waitress.

Official website | GitHub page | PyPI page


Github stars: 4173

Github forks: 203

One of the fastest web frameworks for Python. It’s designed to build APIs. It supports providing of several API versions, automatic API documentation and annotation-powered validation. Also, hug is built on top of another JSON framework which is Falcon. Let’s provide a JSON response via hug.

import hug

def hello():
    return {'message': 'Hello world!'}

Launched with the waitress by command « waitress-serve –port=8080 app:__hug_wsgi__ »

pip freeze contains: appdirs, falcon, hug, packaging, pyparsing, python-mimeparse, requests, six, waitress.

Official website | GitHub page | PyPI page


Github stars: 5192

Github forks: 406

A Flask-like web framework which is developed to be fast. It supports asynchronous request handlers, making your code non-blocking and speedy.

Code to response with {'message': 'Hello world!'} JSON may be seen below.

from sanic import Sanic
from sanic.response import json

app = Sanic()

async def hello(request):
    return json({"message": "Hello world!"})

if __name__ == "__main__":
    app.run(host="", port=8080)

pip freeze lists: aiofiles, appdirs, httptools, packaging, pyparsing, sanic, six, ujson, uvloop.

GitHub page | PyPI page


Github stars: 2981

Github forks: 519

Aiohttp is an asynchronous web framework which heavily utilizes Python 3.5+ async & await features. An example below shows only an obvious non-asynchronous functionality. aiohttp is not just a server web framework, but also the client one. It supports both WebSocket server and client. As it supports integration with Jinja2, the example uses this feature.

from aiohttp import web
import aiohttp_jinja2
import jinja2

def hello(request):
    return {'message': 'Hello world!'}

app = web.Application()
aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader('templates'))
app.router.add_get('/hello', hello)

web.run_app(app, port=8080)

pip freeze lists: aiohttp, aiohttp-jinja2, appdirs, async-timeout, cchardet, chardet, Jinja2, MarkupSafe, multidict, packaging, pyparsing, six, yarl.

Official website | GitHub page | PyPI page


Github stars: 2291

Github forks: 729

A framework for large applications. It aims to be flexible, unlike « everything-in-the-box » Django. For example, templating and database administration require external libraries. Pyramid web applications start from a single-file module and evolve into ambitious projects.

It took time to develop a single file application with Pyramid! Pyramid docs are cheating: if you want to response with a string, you have an example on their home page, but when you attempt to use templating… Docs are unclear, firstly because of unobvious proposed project structure. Pyramid_chameleon has been additionally installed to use Chameleon templating (${} instead of Jinja's {{}}). Here is the code of the application.

from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.renderers import render_to_response

def hello(request):
    return render_to_response('__main__:templates/message.pt',
                              {'message':'Hello world!'},

if __name__ == '__main__':
    config = Configurator()
    config.add_route('hello', '/hello')
    config.add_view(hello, route_name='hello')
    app = config.make_wsgi_app()
    server = make_server('', 6543, app)

pip freeze lists: appdirs, Chameleon, hupper, packaging, PasteDeploy, pyparsing, pyramid, pyramid-chameleon, repoze.lru, six, translationstring, venusian, WebOb, zope.deprecation, zope.interface.

Frameworks below are less popular. However, as they are still being developed, it’s good to mention them.

Official website | GitHub page | PyPI page

This graph shows the history of Google search engine results where Python frameworks appear:


Github stars: 662

Github forks: 27

Built atop asyncio, inspired by Connect and Express frameworks for Node.js. ORM, templating, etc. should be installed manually. Requests are handled by passing through a middleware chain.

GitHub page | PyPI page


Github stars: 345

Github forks: 98

Aims to be « a way between the programmer and the problem ». A usual web application developed by means of CherryPy looks like an ordinary Python application, it works out of the box without a complicated setup and customization. Also, it supports different web servers like Apache, IIS, et cetera. CherryPy contains an embedded web-server, so your application may be deployed anywhere where Python is installed. CherryPy allows to launch multiple HTTP servers at once. Output compression, configurability of every part, flexible plugin system. CherryPy doesn’t force you to use any certain template engine, ORM or JavaScript library, so you may use what you prefer.

Official website | GitHubPage | PyPI page


Github stars: 315

Github forks: 32

A flexible model-driven web framework. Supports REST out-of-the-box. Its main concepts are reusability and extensibility.

Official website | GitHub page | PyPI page


Github stars: 197

Github forks: 48

A MVC web framework.The Features include ORM with real multi-database support, support for horizontal data partitioning, widget system to simplify the development of AJAX apps. Template engine is Kajiki (must be additionally installed). You can develop with TurboGears as it’s a microframework as well as it’s a full-stack solution, installing additional components. Notice that TurboGears2’s PyPI package is called tg.devtools.

Official website | GitHub page | PyPI page


Github stars: 126

Github forks: 30

Circuits has similar features as CherryPy has. Unlike CherryPy, circuits are a highly efficient web framework for developing stand-alone multiprocess applications. It’s event-driven, it supports concurrency, asynchronous I/O components. It’s fully usable out-of-the-box.

Official website | GitHub page | PyPI page


Github stars: 85

Github forks: 9

A component-based WSGI event-driven MVC web framework.

GitHub page | PyPI page


Github stars: 78

Github forks: 16

One of the fastest web frameworks for Python to develop JSON APIs.

Official website | GitHub page | PyPI page


Github stars: 60

Github forks: 7

A light-weight full-stack framework. You can develop an application in a single file or structurize it as you wish.

GitHub page | PyPI page


Github stars: 7

Github forks: 3

A web framework to develop web applications in pure Python. There are widgets which may be used, customized and composed in usual Python code. Those widgets describe a specific server-side and client-side behaviour.

Official pag | GitHub page | PyPI page

The following diagrams present the number of forks and stars on GitHub:

number of forks number of stars


This concise overview leaves the best Python frameworks at your disposal. Try aiohttp or Tornado if you need asynchrony, when you develop something with continuous connections.

Try Django if you develop something rich.

Try Falcon, hug or Sanic if you develop JSON API.

Try Flask if you develop something simple.

Try Pyramid if you develop something rich, but extraordinary.

We can’t single out the best Python framework for web development since the choice of either framework depends on the specific needs of a project. Learn something new and have different tools for different tasks in your toolbox.


Comment installer Sugar CRM sur un serveur dédié VPS avec BitNami ?

Qu’est ce que Sugar CRM ?

sugarcrmSugar CRM est un logiciel de suivi de la relation client très évolué et open-source . Cette solution peut facilement être installée sur un serveur vps à l’aide de l’installeur fourni par l’éditeur Bitnami .

Le site officiel de Sugar CRM : http://www.sugarcrm.com/

Qu’est ce que Bitnami ?

 Bitnami  Bitnami est un éditeur qui propose des solutions completes pour l’installation sur serveurs de nombreuses applications open-sources , dont Sugar CRM .

Le site de Bitnami : https://bitnami.com/

les applications disponibles : https://bitnami.com/stacks


Pour installerSugar CRM il faut que votre vps soit équipé d’une version nue de debian 7 ou supérieure, aucun serveur web ne doit être installé . Vous devez pouvoir vous conecter en ssh .

Au cours de l’installation vous créerez le compte du premier utilisateur qui sera aussi l’administrateur du serveur Sugar CRM . Vous devrez aussi renseigner les paramètres d’une adresse mail pour cet utilisateur , ces paramètres sont les mêmes que ceux que vous renseignez dans un logiciel de messagerie comme windows live mail ou thunderbird ( adresse, mot de passe, serveur smtp , port du serveur ) . Rassemblez toutes ces informations avant de lancer l’installation.


Comment installer Sugar CRM sur un serveur dédié VPS avec BitNami ?

1) – Prérequis :

Les versions de Debian livrées sur les vps LWS varient . Demandez l’installation d’une version 7 ou supérieure nue , ou réinstallez vous même cette version depuis votre pannel client  ( celà effacera toutes les données du serveur !)

a) – Installez nano qui est l’éditeur de texte utilisé dans cette procédure .

apt-get install nano

b) –  Si votre serveur est sous une version Debian 7 , les sources peuvent ne plus être à jour , ouvrez le fichier sources.list

nano /etc/apt/sources.list

Effacez ce qu’il contient ou commentez les lignes existantes avec un # , et collez ces sources à la place :

## Debian Wheezy - dépôts officielsdeb http://ftp.fr.debian.org/debian/ wheezy maindeb http://ftp.fr.debian.org/debian/ wheezy-updates maindeb http://security.debian.org/ wheezy/updates main

mettez à jour le serveur

apt-get updateapt-get upgrade

c) – Pour éviter des erreurs de certificats, installez ca-certificates

apt-get install ca-certificates

d) – reconfigurez les locales en lançant cette commande

dpkg-reconfigure locales

lorsque  Jeux de paramètres régionaux à créer : s’affiche, entrez le numéro qui correspond à fr_FR.UTF-8 UTF-8

e)- réglez la zone horaire de votre serveur

dpkg-reconfigure tzdata

Choisissez 8 ( pour europe ) et 35 ( pour Paris )

f) – Installez Fail2ban , un logiciel qui protège votre serveur des attaques par bruteforce . Vous disposerez d’une protection basique de l’accès SSH immédiatement . Si vous désirez optimiser la protection rendez vous sur cette page : https://www.isalo.org/wiki.debian-fr/Fail2ban

apt-get install fail2ban

2) – Installation de Sugar CRM

Connectez vous en ssh au serveur vps .

placez vous maintenant dans un répertoire temporaire

cd /tmp

Avec votre navigateur rendez-vous sur la page de téléchargement Gitlab de bitnami : https://bitnami.com/stack/sugarcrm

Cliquez droit sur le lien de téléchargement de la version Linux 64 bits et copiez le .

Retournez sur votre console ssh , entrez wget suivi d’un espace collez le lien de téléchargement puis validez .

( l’adresse du lien donné dans l’exemple ci dessous n’est peut-être plus valable, relevez bien le lien sur le site de l’éditeur Bitnami )

wget https://bitnami.com/redirect/to/65094/bitnami-sugarcrm-6.5.21-1-linux-x64-installer.run

Une fois le téléchargement terminé vous devez rendre exécutable le fichier avec la commande chmod 755 [nom du fichier]

pour notre exemple :

chmod 755 bitnami-sugarcrm-6.5.21-1-linux-x64-installer.run

Entrez ensuite la commande suivante pour lancer l’installation ./[nom du fichier téléchargé] ce qui donne pour notre exemple :


L’installeur va vous poser plusieurs questions , répondez ainsi :

PhpMyAdmin [Y/n] :    YIs the selection above correct? [Y/n]:      YSelect a folder [/opt/sugarcrm-6.5.21-1]:     validezYour real name [User Name]:                         votre NomEmail Address [user@example.com]:            votre adresse mailLogin [user]:                                          l'identifiant que vous souhaitez utiliser pour accéder à SugarCRMPassword :                                         choisissez un mot de passePlease confirm your password :       confirmez le mot de passeDo you want to configure mail support? [y/N]:                  YDefault email provider:[1] GMail[2] CustomPlease choose an option [1] :             choisissez 1 pour une adresse chez gmail sinon choisissez 2Username []:                                  Attention ! entrez votre adresse mail complète ! ex: paul@exemple.comPassword :                                     Le mot de passe de votre adresse mailRe-enter :                                       confirmez le mot de passeSMTP Host []:                               l'adresse du serveur SMTP de votre hébergeur MailSecure connection[1] None[2] SSL[3] TLSPlease choose an option [3] :            choisissez le chiffre qui correspond au mode de connection à votre serveur smtp Do you want to continue? [Y/n]:          Y

L’installation va durer quelques minutes , à la fin l’installeur vous demande si vous voulez démarrer SugarCRM – répondez Y

Launch Bitnami SugarCRM Stack [Y/n]:      Y

Les trois dernières commandes vont vous permettre de faire démarrer SugarCRM avec votre serveur vps si nécessaire .

Il s’agit de se placer dans le répertoire d’installation, de copier le script de démarrage dans /etc/init.d et de l’activer pour le démarrage .

cd /opt/sugarcrm-6.5.22-0cpt ctlscript.sh /etc/init.dupdate-rc.d ctlscript.sh start 2 2 .


Sugar CRM est prêt, vous pouvez accéder à l’interface web en entrant l’adresse de votre serveur .