Python has been the trending language and becoming more and more popular since a few years. Although it gained its popularity in 2003 , it was introduced in the 1980s by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC language.
It gained its popularity due to its simple english statements like syntax , extensible and rich set of libraries and frameworks, readymade packages and modules.
In this blog we’ll discuss..
What Are Frameworks
A framework is a software, with which you don’t need to create or implement things from scratch and instead use the given basic structure and just start making your own project. And that’s why frameworks usually have boilerplates.
Frameworks can reduce time required to develop a project.
For example, Django and Flask are back-end frameworks built on top of Python and as so called Python Frameworks, whereas React and Angular are front-end frameworks known as Javascript Frameworks.
Types Of Frameworks
Frameworks are in almost every domain and mostly open-source,you can just install it in your IDE and get started or contribute a new feature or request an edit. Most famous categories where frameworks are used for development are
Top 5 Frameworks In Python
1. Django
The web framework for perfectionists with deadlines.
Django is..
It is a high-level Python Framework.It can handle much of the hassle of web development so that you can just focus on writing the application without reinventing the wheel. Django uses Object Relational Mapping(ORM) to connect to a database using object oriented paradigm.
Check out this Online Python Course by FITA. FITA provides a complete Django course where you will be building real-time projects like Bitly and Twitter bundled with Python training.
Hello world App with Django
fromdjango.httpimport HttpResponse fromdjango.viewsimport View classHomeView(View): def get(self, request, *args, **kwargs): return HttpResponse(‘Hello World!’) |
Top Companies using Django..
2. Flask
One drop at a time
Flask is
Flask is another micro web framework for web application development. Flask is easy to get started as a beginner because there are less boilerplates than django and the developer can have more control over structure and flow of the application.
Hello World App with Flask
from flask import Flask app = Flask(__name__) @app.route(‘/’) def hello_world(): return “Hello World!” |
Top Companies using Flask..
3. Web2py
Simple And Easy To Learn
Web2py has…
class HelloRequestHandler(BaseHTTPRequestHandler): def do_GET(self): if self.path != ‘/’: self.send_error(404, “Not found”) return self.send_response(200) self.send_header(‘Content-type’, ‘text/html; charset=utf-8’) self.end_headers() response_text = textwrap.dedent(”’\ <html> <body> <h1>Hello World!</h1> </body> </html> ”’) self.wfile.write(response_text.encode(‘utf-8’)) server_address = (”, 8000) httpd = HTTPServer(server_address, HelloRequestHandler) httpd.serve_forever() |
Companies Using Web2py..
4. CherryPy
A minimalist python framework
CherryPy is…
Cherrypie does not provide utilities for frontend framework and instead lets the developer make those decisions. Contrast to other python frameworks like django, flask or bottle CherryPy does its best to give full control over application structure and design with almost no boilerplates.
Hello World App with CherryPy.
import cherrypy class HelloWorld(object): @cherrypy.expose def index(self): return “Hello World!” cherrypy.quickstart(HelloWorld()) |
Companies using CherryPy.
5. TurboGears
The Web Framework That Scales With You
Turbo Gears provides..
TurboGears ,a mega python web framework uses WSGI components and is designed around MVC (Model-View-Controller) module. It is easier and more maintainable.
Hello world app with Turo Gears
from wsgiref.simple_server import make_server fromtgimport expose, TGController fromtgimport MinimalApplicationConfigurator classRootController(TGController): @expose(content_type=”text/plain”) def index(self): return ‘Hello World’ config = MinimalApplicationConfigurator() config.update_blueprint({ ‘root_controller’: RootController() }) httpd = make_server(‘ ‘, 8080, config.make_wsgi_app()) httpd.serve_forever() |
Top companies using TurboGear..
This was all about the famous frameworks in python with their applications. To get in-depth knowledge of Python along with its various applications and real-time projects, you can enroll in Python Course in Chennai or Python Course in Bangalore by FITA at an affordable price, which includes certification, support with career guidance assistance.