GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.fullstackpython.com — Flask FlaskFlask (source code) is a Python web framework built with a small core and easy-to-extend philosophy. Why is Flask a good web framework choice?Flask is considered more Pythonic than the Django web framework because in common situations the equivalent Flask web application is more explicit. Flask is also easy to get started with as a beginner because there is little boilerplate code for getting a simple app up and running. For example, here is a valid "Hello, world!" web application with Flask: from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == '__main__':
app.run()
The above code shows "Hello, World!" on localhost port 5000 in a web browser
when run with the The equivalent "Hello, World!" web application using the Django web framework would involve significantly more boilerplate code. Flask was also written several years after Django and therefore learned from the Python community's reactions as the framework evolved. Jökull Sólberg wrote a great piece articulating to this effect in his experience switching between Flask and Django. Flask is an implementation of the web frameworks concept. Learn how these parts fit together in the web development chapter or view all topics.
How does Flask relate to the Pallets Projects?Flask was originally designed and developed by Armin Ronacher as an April Fool's Day joke in 2010. Despite the origin as a joke, the Flask framework became wildly popular as an alternative to Django projects with their monolithic structure and dependencies. Flask's success created a lot of additional work in issue tickets and pull requests. Armin eventually created The Pallets Projects collection of open source code libraries after he had been managing Flask under his own GitHub account for several years. The Pallets Project now serves as the community-driven organization that handles Flask and other related Python libraries such as Lektor, Jinja and several others. Flask tutorialsThe "Hello, World!" code for Flask is just seven lines of code but learning how to build full-featured web applications with any framework takes a lot of work. These resources listed below are the best up-to-date tutorials and references for getting started.
Intermediate to advanced Flask resourcesOnce you move past the beginner tutorials and have created a few Flask projects you will want to learn how to use Flask extensions, deploy your code and integrate web APIs to build more extensive functionality. The following tutorials will guide you through more advanced topics and provide solid learning materials, especially when combined with the example real-world projects listed in the next section.
Open source Flask example projectsFlask's lack of standard boilerplate via a commandline interface for setting up your project structure is a double edged sword. When you get started with Flask you will have to figure out how to scale the files and modules for the code in your application. The following open source projects range from simple to complex and can give you ideas about how to working on your codebase.
Flask project templatesFlask's wide array of extension libraries comes at the cost of having a more complicated project setup. The following project templates provide a starter base that you can either use for your own applications or just learn various ways to structure your code.
Open source code for learning FlaskThere are many open source projects that rely on Flask to operate. One of the best ways to learn how to use this framework is to read how other projects use it in real-world code. This section lists these code examples by class and method in Flask. Flask: Extensions, Plug-ins and Related Libraries & Example Projects and Codeflask.app BadRequest, Flask, Headers, ImmutableDictflask.blueprints Blueprintflask.cli AppGroup, DispatchingApp, FlaskGroup, ScriptInfo, pass_script_info, with_appcontextflask.ctx after_this_request, has_app_context, has_request_contextflask.globals current_app, g, request, sessionflask.helpers flash, get_root_path, make_response, safe_join, send_file, url_forflask.json JSONEncoder, jsonifyflask.sessions BadSignature, SessionInterface, SessionMixinflask.signals Namespace, got_request_exceptionflask.templating render_template, render_template_stringflask.views MethodView, View, http_method_funcsWhat web development topic do you want to learn next?
1. Introduction
2. Development Environments
3. Data
4. Web Development
Web Frameworks
Django
Flask
Bottle
Pyramid
TurboGears
Falcon
Morepath
Sanic
Other Web Frameworks
Template Engines
Jinja2
Mako
Django Templates
Web Design
HTML
Cascading Style Sheets (CSS)
Responsive Design
Minification
CSS Frameworks
Bootstrap
Foundation
JavaScript
React
Vue.js
Angular
Task Queues
Celery
Redis Queue (RQ)
Dramatiq
Static Site Generators
Pelican
Lektor
MkDocs
Testing
Unit Testing
Integration Testing
Debugging
Code Metrics
Networking
HTTPS
WebSockets
WebRTC
Web APIs
Microservices
Webhooks
Bots
API Creation
API Frameworks
Django REST Framework
API Integration
Twilio
Stripe
Slack
Okta
Security
SQL Injection
CSRF
5. Deployment
6. DevOps
Changelog
What Full Stack Means
About the Author
Future Directions
Page Statuses
...or view the full table of contents.
Full Stack Python
Full Stack Python
is an open book that explains concepts in plain language and provides
helpful resources for those topics.
Updates via Twitter & Facebook. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |