How much of a "micro" framework...?

https://slides.com/superdiana/flask-micro

$whoami

Diana Rodríguez

Google Developer Expert:

- Web Technologies            - Google Maps Platform

- Google Cloud Platform    - Firebase

Auth0 Ambassador

Microsoft MVP: Developer Technologies 

Python Developer Advocate @ Vonage

 

🚀  https://superdi.dev

🐦  @cotufa82

 

Someone who learns new things every single day!!

$whoami-NOT

  • Framework Agnostic

  • Weapon of Choice

  • Zero Wars/Mobs/Cults

  • "Obvious" examples

🛁🧼

SOME CONTEXT

django is a Python-based free and open-source web framework, which follows the model-template-view (MTV) architectural pattern. It eases the creation of complex, database-driven websites.

Flask is a Python microframework based in Werkzeug, Jinja 2 and the bestest intentions. With Flask we can build Web & Restful apps in an extremely simple way.

"Microframework"

DJANGO ARCHITECTURE 

Pros!

  • Learning curve ✅
  • "production ready" ✅
  • Routing ✅
  • Supports sessions & cookies
  • Extensible ✅
  • No "baked in" ORM & Admin ✅
  • Excellent documentation ✅

Cons

  • None
  • Complex for big apps
  • Small community in comparison to django

So... 🤔

  • Is Flask for small projects only?
  • Why is it called a micro framework?
  • Can it do everything Django does?
  • When should i use Flask instead of Django?

Full
Stack
Flask!?

FLASK IN ACTION

CONTEXT

👂🏼

😴

🚫

🧐

HOW?

3.9 mmol/L
or
 70 mg/dl

🚨⬇️🚨

10 mmol/L
 or
 180 mg/dl

🚨⬆️🚨

📲

    <head>
    <link rel="stylesheet" href=
      "{{ url_for('static', filename='css/materialize.min.css') }}">
    {% block head %}{% endblock %}
    </head>
   

layout.html

{% extends "layout.html" %}
  {% block head %}
  <script src="https://apis.google.com/js/platform.js" async defer></script>
  <meta name="google-signin-client_id" content="{{ client_id }}">
  {% endblock %}
  

login.html

@app.route('/login',methods=["POST"])
def login():

app.py

IN CONCLUSION

  • Awesome option if you're starting you journey with Python, and if not, it is a great option as well! 😜
  • Not limited to small projects only.
  • Add or take at will to meet your needs!
  • Once you gain proficiency with Flask, moving to Django will be very easy...
  • ... Or maybe you won't need to move at all!

MICRO FRAMEWORK?

RESOURCES

MUCHAS GRACIAS!!

@cotufa82

https://superdi.dev

RESOURCES

Made with Slides.com