[hemmerling] Python 10/10 - Web Application Frameworks

How to design and create Web Applications with Web Frameworks & other Frameworks

Comparison of Python Frameworks suitable for Web Services

Framework Webserver User Interface Object Relationa Model ( ORM ) Database Shipped with REST API functions Comment
Django Yes Yes Yes Yes Yes, using “Django REST framework”
Flask Yes No No No Yes
Bottle Yes No No No Yes
SQL Alchemy No No Yes Yes No Suitable for Web services, though no Web framework

Implementation Suggestions

  • Experts suggested not to consider a self-implementation of a REST API, please use frameworks with REST support, or REST addons for frameworks :-).
  • Experts considered:
    • Flask and Bottle to be good to build a Web API ( with some business logic written in Python ), but no data storage is needed.
    • Django to be good:
      • for database-driven applications, where just a limited number of pages is provided by the application. No “new” pages are generated, but the data of existing pages is frequently updated.
      • to do data collecting of instrumentation data of Internet-of-Thing devices, both with API ( with some business logic written in Python, making use of the data collected in the database ) and user interface. However, if the major data analysis application on the server / in the cloud is written in Java ( e.g. Opensource business intelligence software ), it should be considered to write the whole web application in Java ( e.g. with Tomcat Server ).
      • Front-end for database, e.g. IOT database, Industry 4.0 database.
        • But it mustn´t be the right choice to receive the IOT data from the IOT devices. The requirements for such a webservice depend on
          • How many sources send data ( push ) or must be polled ?
          • Are just small data packages sent, or big data ( BLOBs, e.g. photos ) ?
          • Does the data transfer happen in “normal” speed, or does it take a minute or longer to receive even a small data package with a “minimum” transfer speed ?!

Implementation Example

  • Speech “Building data products with Flask and AngularJS” by Andy Goldschmidt on the Python Unconference Hamburg in Hamburg, 2015-09-05.
        • “Demo webapp that parses a CSV in the frontend and applies a ML algorithm on the parsed data in the backend”.
        • An AngularJS frontend in the browser → RESTful JSON API → Flask Web Application → Pandas Scikit.
        • In this special case, image processing is done in the browser, not by an OpenCV application on the server!
        • 2 Functions:
          1. Upload CVS file to classify your data.
          2. Upload images, get back numeric values.

Web Servers & Web Frameworks

AccessGrid

  • AccessGrid - Free “grid” webserver system, based on Python. “An ensemble of resources including multimedia large-format displays, presentation and interactive environments, and interfaces to Grid middleware and to visualization environments”.

ACME Systems

Authomatic

  • GitHub.io "Authomatic", GitHub "peterhudec/authomatic" - “A framework agnostic library, for Python web applications, with a minimalistic but powerful interface which simplifies authentication of users, by third party providers like Facebook or Twitter, through standards like OAuth and OpenID”.

Bokeh

  • Bokeh, GitHub "bokeh" - ”“Bokeh is a Python interactive visualization library that targets modern web browsers for presentation”, “Interactive Web Plotting for Python”.

Bottle: Python Web Framework

CherryPy - A Minimalist Python Web Framework

Django

The Framework

Extensions and Code Snippets

Django Applications which provide functional Extensions for own Django Applications
REST API
Code Snippets
  • Djangosnippets - “A site for users of the Django web framework to come together and share useful 'snippets' of reusable code”.
Package Resources
  • Django Packages - “A directory of reusable apps, sites, tools, and more for your Django projects”.

Object Relational Model ( ORM )

How To Start with Django Development

How to proceed
  1. “django-admin startproject your_projectname”.
  2. “manage.py syncdb”.
  3. “manage.py pystartup your_application”.
  4. In ”your_projectname/setup.py”, disable “Debug = True” and “Template_Debug=True” for production use.
  5. Now there is the Django application available at http://localhost:8000/, and an admin interface at http://localhost:8000/admin.
  6. “manage.py admin_generator your_application”.
How to setup the HTML5 Stuff for use with Django Applications

Tutorials

Resources

  • Experts told me: “Django” has 1000s of unactivated features. So almost everyting is already “there”, so that you can use with without much own effort.
  • “Py.test” ( See: Unit Test / Module Test ) is the defined as standard test framework with Django :-), there are many test application examples provided.
  • “Django Runserver”, the webserver provided with “Django”, as most basic webservers provided by software frameworks, is not intended for production use. So you need a professional webserver ( See Content Management Systems ( CMS ) ), where you can deploy your Django web application.
  • Structure of a website built with Django:
    • A Django project provides a website. It is the collection of several Django apps.
    • A Django app provides a single page ( CMS, newfeed, formular, weather report,..). The Django web application may provide an unlimited copy if the pages. But though the contents of the page is dynamic by the Python code which may include dynamic data by request, each page has a fixed task - fixed by the code at implementation time.
    • A CMS system on the top of Django may provide a useful interface for applications, where new pages with new contents are generated frequently.
  • Classy Class-Based Views - “Detailed descriptions, with full methods and attributes, for each of Django's class-based generic views”.
  • Blog Reinout van Rees’ weblog- “I work a lot with Python (programming language) and Django (website framework)”.

Genshi

Gunicorn

  • Gunicorn - “Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resources, and fairly speedy”.

iix - a simple python webserver

Flask

Pylons Project

Python Paste

TurboGears Web Framework

Twisted

Mamba / BlackMamba

  • BlackMamba ( Mamba ) - “Small and high level asynchronous web applications framework and WSGI web server”, “Mamba is built on top of Twisted Web and uses Twisted as WSGI web server as well”.

webpy

  • webpy - “A web framework for Python that is as simple as it is powerful”.

web2py

Resources

Web CMS

Major Web CMS and other Applications based on Django & Python 3.x

Django CMS

Django-Neon

  • Django-Neon - “The CMS-Application for Django-Projects”.

FeinCMS

Mezzanine

Wagtail CMS

    • “A Django content management system focused on flexibility and user experience”. Based on Python3.
    • It is a framework to build a CMS, not a ready-to-use CMS.

Some other Web CMS and other Applications based on Django & Python 3.x

Django page CMS

Some other Web CMS and other Applications based on Django & Python 2.x

Django Fiber

Ella

Opps

  • GitHub "Opps" - “A Django-based CMS for the magazines, newspappers websites and portals with high-traffic”.

Transifex - Web-based Translation Platform based on Django

The commercial Service
  • The current commercial online service Transifex.
The OpenSource Tool
Resources

Widgy

ZOPE & Web CMS based on ZOPE

Plone

ZOPE

The Tool
  • The OpenSource web application server Zope.ORG - “An open source web application server primarily written in the Python programming language. It features a transactional object database which can store not only content and custom data, but also dynamic HTML templates, scripts, a search engine, and relational database (RDBMS) connections and code”.
Applications
Resources

Resources

Business Applications ( Webshop, ERP,..)

Commercial Application Servers

Resources

Python Web Frameworks, which might be used to build RPC Services

Python Web Frameworks, which might be used to build REST Services

Commercial Online Services for Python Web Applications

    • “Python Profiling Tool”.
    • “Actionable insights to monitor & improve the performance of your Python applications”,
    • Support of web application frameworks: django, Pylons, Bottle, CherryPy, Web2Py, Flask.

Appropriate OpenDirectory Directory Pages

 
en/python10.html.txt · Last modified: 2017/06/26 06:35 (external edit) · []
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki