SlideShare une entreprise Scribd logo
1  sur  85
Télécharger pour lire hors ligne
A Python a web service

A Python a web service
@vtemian
A Python a web service

Let’s imagine
a perfect world...
A Python a web service

WEB APPLICATION
A Python a web service

Tools & Utilities

WEB APPLICATION
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

management tools
supporting services

Worker Process
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

management tools

user interface

supporting services

api service
data persistence
auth
crud admin

Worker Process
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

data persistence
auth
crud admin
A Python a web service

Single codebase are
EVIL!
A Python a web service

WEB APPLICATION

Tools & Utilities

Web Process

Worker Process

management tools

user interface

deferred tasks

supporting services

api service

scheduled tasks

SS
E
M
AL
T
TO
data persistence
auth
crud admin
A Python a web service

Decouple!
A Python a web service

Developers

End Users

API service
Data persistence

Frontend
A Python a web service

Developers

API service

End Users

API service

Internal

API service

Data persistence
A Python a web service

Good API
A Python a web service

Good API
A Python a web service

Good API
Intuitive

similar things should be similar,
ugly things should look ugly

Documented
Opinionated
A Python a web service

Features

posting of data
with validation

pagination

propper HTTP
response handling
permissions

throttling
serialization

authentification
A Python a web service

Django

regex routing system
A Python a web service

Django

regex routing system

built-in orm
A Python a web service

Django

users = Users.objects.filter(last_login__lt=timestamp)
A Python a web service

Django

regex routing system

built-in orm

templating system
auth
management tools

crud admin
migrations
testing tools

makes decision for you
A Python a web service

NOBODY CARES
A Python a web service

Developers

API service

Django
End Users

API service

Internal

API service

Data persistence
A Python a web service

Django

regex routing system

testing tools

templating system
makes decision for you
A Python a web service
A Python a web service

Django REST Framework
A Python a web service

Just install it, write 20 lines of code
> CRUD API
A Python a web service

API Console
A Python a web service

Great community
A Python a web service

Easy to document your API
A Python a web service

Integration test using
APIRequestFactory
A Python a web service

OAuth 1 & 2 out of the box
A Python a web service

Serialization
A Python a web service

Django paginator
or PaginationSerializer
A Python a web service

Object or field level validation
A Python a web service

Using django caching policy
A Python a web service

For throttling, just add:
DEFAULT_THROTTLE_CLASSES +
DEFAULT_THROTTLE_RATES
in settings.py
A Python a web service

Powerful and extensible
object level permissions
A Python a web service
A Python a web service

Depends on Django >
get all the Django mess
A Python a web service

Pretty huge
A Python a web service

Can do a lot of black magic
A Python a web service

Rigid
A Python a web service

Django Tastypie
A Python a web service

Plug and play
A Python a web service

Decent auth support
A Python a web service

Documented
A Python a web service

Still supported
A Python a web service

Paginator for pagination
A Python a web service

Validation --- you can extend it
A Python a web service

serializer = Serializer(formats=[‘json’, ‘jsonp’, ‘xml’,
‘yaml’, ‘html’, ‘plist’])
A Python a web service

throttle = BaseThrottle(throttle_at=100)
A Python a web service

NO NO NO
A Python a web service

Not intuitive
A Python a web service

Ugly
A Python a web service
class ParentResource(ModelResource):
children = fields.ToManyField(ChildResource, ‘children’)
def prepend_urls(self):
return [
url(r”^(?P<resource_name>%s)/(?P<pk>w[w/-]*)/children%s$” % (self._meta.resource_name, trailing_
slash()), self.wrap_view(‘get_children’), name=”api_get_children”),
]
def get_children(self, request, **kwargs):
try:
bundle = self.build_bundle(data={‘pk’: kwargs[‘pk’]}, request=request)
obj = self.cached_obj_get(bundle=bundle, **self.remove_api_resource_names(kwargs))
except ObjectDoesNotExist:
return HttpGone()
except MultipleObjectsReturned:
return HttpMultipleChoices(“More than one resource is found at this URI.”)
child_resource = ChildResource()
return child_resource.get_detail(request, parent_id=obj.pk)
A Python a web service

Depends on Django >
get all the Django mess
A Python a web service

Can do lot black magic
Can do aalot of black magic
A Python a web service

Rigid
A Python a web service

Flask
A Python a web service
A Python a web service

from flask import Flask
app = Flask(__name__)
@app.route(“/”)
def hello():
return “Hello World!”
if __name__ == “__main__”:
app.run()
A Python a web service

Werkzeug, Jinja 2 and good intentions
A Python a web service

Very small and easy to learn
(super intuitive)
A Python a web service

Solid and well documented
A Python a web service

Awesome and strong community
A Python a web service

Great debugging tools
A Python a web service

Application dispatcher (on wsgi level)
A Python a web service

Integrating unittest and integration tests
(also check flask-testing)
A Python a web service

Signals
A Python a web service

Configuration == dict
A Python a web service

Blueprints
A Python a web service

Response object == wsgi app
A Python a web service

SHOW ME THE SOURCE
YOU MUST
A Python a web service

BYOB
A Python a web service

Some batteries
Flask-SQLAlchemy

Flask-Testing
Flask-Oauthlib

Flask-Classy
Flask-Cache

Flask-Script
Flask-Principal
A Python a web service
A Python a web service

Q/A
A Python a web service

Resources
Kenneth Reitz
Flask Goodness
API Driven Development
How I develop Things and Why?
Kevin Lacker
How to Design Great APIs?
A Python a web service

Thank you!

DRINK ALL THE BEERS!

Contenu connexe

Tendances (20)

Sql injection attack
Sql injection attackSql injection attack
Sql injection attack
 
Strings in Java
Strings in JavaStrings in Java
Strings in Java
 
Dictionaries in Python
Dictionaries in PythonDictionaries in Python
Dictionaries in Python
 
Web security
Web securityWeb security
Web security
 
Access modifiers in Python
Access modifiers in PythonAccess modifiers in Python
Access modifiers in Python
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
 
Python : Data Types
Python : Data TypesPython : Data Types
Python : Data Types
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
 
Python SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite DatabasePython SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite Database
 
A Brief Introduction in SQL Injection
A Brief Introduction in SQL InjectionA Brief Introduction in SQL Injection
A Brief Introduction in SQL Injection
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Man in the middle attack (mitm)
Man in the middle attack (mitm)Man in the middle attack (mitm)
Man in the middle attack (mitm)
 
Python OOPs
Python OOPsPython OOPs
Python OOPs
 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in java
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
 
Structure and Enum in c#
Structure and Enum in c#Structure and Enum in c#
Structure and Enum in c#
 
Java Threads
Java ThreadsJava Threads
Java Threads
 
OOP with Java - Continued
OOP with Java - Continued OOP with Java - Continued
OOP with Java - Continued
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 
Python twisted
Python twistedPython twisted
Python twisted
 

En vedette

Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTPMykhailo Kolesnyk
 
Building an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkBuilding an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkChristopher Foresman
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkMarcel Chastain
 
Python et les bases de données non sql
Python et les bases de données non sqlPython et les bases de données non sql
Python et les bases de données non sqlbchesneau
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsSolution4Future
 
Building Automated REST APIs with Python
Building Automated REST APIs with PythonBuilding Automated REST APIs with Python
Building Automated REST APIs with PythonJeff Knupp
 
Python et son intégration avec Odoo
Python et son intégration avec OdooPython et son intégration avec Odoo
Python et son intégration avec OdooHassan WAHSISS
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSHannes Hapke
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with PythonLarry Cai
 
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour androidDébuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour androidBosco Basabana
 
Créer une api publique avec Django REST framework
Créer une api publique avec Django REST frameworkCréer une api publique avec Django REST framework
Créer une api publique avec Django REST frameworkBleemeo
 
Cours python avancé
Cours python avancéCours python avancé
Cours python avancépierrepo
 
Developing RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBDeveloping RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBNicola Iarocci
 

En vedette (16)

Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
 
Django by mrjmad
Django by mrjmadDjango by mrjmad
Django by mrjmad
 
Building an API with Django and Django REST Framework
Building an API with Django and Django REST FrameworkBuilding an API with Django and Django REST Framework
Building an API with Django and Django REST Framework
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-Framework
 
Python et les bases de données non sql
Python et les bases de données non sqlPython et les bases de données non sql
Python et les bases de données non sql
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
Building Automated REST APIs with Python
Building Automated REST APIs with PythonBuilding Automated REST APIs with Python
Building Automated REST APIs with Python
 
Python et son intégration avec Odoo
Python et son intégration avec OdooPython et son intégration avec Odoo
Python et son intégration avec Odoo
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
 
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour androidDébuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
Débuter avec phonegap (APACHE CORDOVA) dans eclipse pour android
 
Créer une api publique avec Django REST framework
Créer une api publique avec Django REST frameworkCréer une api publique avec Django REST framework
Créer une api publique avec Django REST framework
 
Cours python avancé
Cours python avancéCours python avancé
Cours python avancé
 
Developing RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBDeveloping RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDB
 
Apache Cordova 3.3 de zéro
Apache Cordova 3.3 de zéroApache Cordova 3.3 de zéro
Apache Cordova 3.3 de zéro
 

Similaire à A python web service

Crossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialCrossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialBastian Hofmann
 
Dev309 from asgard to zuul - netflix oss-final
Dev309  from asgard to zuul - netflix oss-finalDev309  from asgard to zuul - netflix oss-final
Dev309 from asgard to zuul - netflix oss-finalRuslan Meshenberg
 
Crossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialCrossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialBastian Hofmann
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기lanslote
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog SampleSkills Matter
 
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...Amazon Web Services
 
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...Amazon Web Services
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesTikal Knowledge
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Startedguest1af57e
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django MeetupMike Malone
 
Service workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua PerformanceService workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua PerformancePiero Bellomo
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGabriel Lucaciu
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Mario Cardinal
 
Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017Jens Ravens
 
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017Amazon Web Services
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial之宇 趙
 
Java-Jersey 到 Python-Flask 服務不中斷重構之旅
Java-Jersey 到 Python-Flask 服務不中斷重構之旅Java-Jersey 到 Python-Flask 服務不中斷重構之旅
Java-Jersey 到 Python-Flask 服務不中斷重構之旅Max Lai
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterHaehnchen
 

Similaire à A python web service (20)

Crossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialCrossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocial
 
Dev309 from asgard to zuul - netflix oss-final
Dev309  from asgard to zuul - netflix oss-finalDev309  from asgard to zuul - netflix oss-final
Dev309 from asgard to zuul - netflix oss-final
 
Crossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocialCrossing the Boundaries of Web Applications with OpenSocial
Crossing the Boundaries of Web Applications with OpenSocial
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
 
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
 
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
 
The Big Picture and How to Get Started
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
 
Motion Django Meetup
Motion Django MeetupMotion Django Meetup
Motion Django Meetup
 
Service workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua PerformanceService workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua Performance
 
Gohan
GohanGohan
Gohan
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress App
 
Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.Best Practices for Architecting a Pragmatic Web API.
Best Practices for Architecting a Pragmatic Web API.
 
Crafting [Better] API Clients
Crafting [Better] API ClientsCrafting [Better] API Clients
Crafting [Better] API Clients
 
Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017
 
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
How to Build a Backend for an Alexa Smart Home Skill - ALX316 - re:Invent 2017
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
Java-Jersey 到 Python-Flask 服務不中斷重構之旅
Java-Jersey 到 Python-Flask 服務不中斷重構之旅Java-Jersey 到 Python-Flask 服務不中斷重構之旅
Java-Jersey 到 Python-Flask 服務不中斷重構之旅
 
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years laterSymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
SymfonyCon Berlin 2016 - Symfony Plugin for PhpStorm - 3 years later
 

Dernier

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 

Dernier (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 

A python web service

  • 1. A Python a web service A Python a web service @vtemian
  • 2. A Python a web service Let’s imagine a perfect world...
  • 3. A Python a web service WEB APPLICATION
  • 4. A Python a web service Tools & Utilities WEB APPLICATION
  • 5. A Python a web service WEB APPLICATION Tools & Utilities Web Process
  • 6. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process
  • 7. A Python a web service WEB APPLICATION Tools & Utilities Web Process management tools supporting services Worker Process
  • 8. A Python a web service WEB APPLICATION Tools & Utilities Web Process management tools user interface supporting services api service data persistence auth crud admin Worker Process
  • 9. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 10. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 11. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 12. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 13. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks data persistence auth crud admin
  • 14. A Python a web service Single codebase are EVIL!
  • 15. A Python a web service WEB APPLICATION Tools & Utilities Web Process Worker Process management tools user interface deferred tasks supporting services api service scheduled tasks SS E M AL T TO data persistence auth crud admin
  • 16. A Python a web service Decouple!
  • 17. A Python a web service Developers End Users API service Data persistence Frontend
  • 18. A Python a web service Developers API service End Users API service Internal API service Data persistence
  • 19. A Python a web service Good API
  • 20. A Python a web service Good API
  • 21. A Python a web service Good API Intuitive similar things should be similar, ugly things should look ugly Documented Opinionated
  • 22. A Python a web service Features posting of data with validation pagination propper HTTP response handling permissions throttling serialization authentification
  • 23. A Python a web service Django regex routing system
  • 24. A Python a web service Django regex routing system built-in orm
  • 25. A Python a web service Django users = Users.objects.filter(last_login__lt=timestamp)
  • 26. A Python a web service Django regex routing system built-in orm templating system auth management tools crud admin migrations testing tools makes decision for you
  • 27. A Python a web service NOBODY CARES
  • 28. A Python a web service Developers API service Django End Users API service Internal API service Data persistence
  • 29. A Python a web service Django regex routing system testing tools templating system makes decision for you
  • 30. A Python a web service
  • 31. A Python a web service Django REST Framework
  • 32. A Python a web service Just install it, write 20 lines of code > CRUD API
  • 33. A Python a web service API Console
  • 34. A Python a web service Great community
  • 35. A Python a web service Easy to document your API
  • 36. A Python a web service Integration test using APIRequestFactory
  • 37. A Python a web service OAuth 1 & 2 out of the box
  • 38. A Python a web service Serialization
  • 39. A Python a web service Django paginator or PaginationSerializer
  • 40. A Python a web service Object or field level validation
  • 41. A Python a web service Using django caching policy
  • 42. A Python a web service For throttling, just add: DEFAULT_THROTTLE_CLASSES + DEFAULT_THROTTLE_RATES in settings.py
  • 43. A Python a web service Powerful and extensible object level permissions
  • 44. A Python a web service
  • 45. A Python a web service Depends on Django > get all the Django mess
  • 46. A Python a web service Pretty huge
  • 47. A Python a web service Can do a lot of black magic
  • 48. A Python a web service Rigid
  • 49. A Python a web service Django Tastypie
  • 50. A Python a web service Plug and play
  • 51. A Python a web service Decent auth support
  • 52. A Python a web service Documented
  • 53. A Python a web service Still supported
  • 54. A Python a web service Paginator for pagination
  • 55. A Python a web service Validation --- you can extend it
  • 56. A Python a web service serializer = Serializer(formats=[‘json’, ‘jsonp’, ‘xml’, ‘yaml’, ‘html’, ‘plist’])
  • 57. A Python a web service throttle = BaseThrottle(throttle_at=100)
  • 58. A Python a web service NO NO NO
  • 59. A Python a web service Not intuitive
  • 60. A Python a web service Ugly
  • 61. A Python a web service class ParentResource(ModelResource): children = fields.ToManyField(ChildResource, ‘children’) def prepend_urls(self): return [ url(r”^(?P<resource_name>%s)/(?P<pk>w[w/-]*)/children%s$” % (self._meta.resource_name, trailing_ slash()), self.wrap_view(‘get_children’), name=”api_get_children”), ] def get_children(self, request, **kwargs): try: bundle = self.build_bundle(data={‘pk’: kwargs[‘pk’]}, request=request) obj = self.cached_obj_get(bundle=bundle, **self.remove_api_resource_names(kwargs)) except ObjectDoesNotExist: return HttpGone() except MultipleObjectsReturned: return HttpMultipleChoices(“More than one resource is found at this URI.”) child_resource = ChildResource() return child_resource.get_detail(request, parent_id=obj.pk)
  • 62. A Python a web service Depends on Django > get all the Django mess
  • 63. A Python a web service Can do lot black magic Can do aalot of black magic
  • 64. A Python a web service Rigid
  • 65. A Python a web service Flask
  • 66. A Python a web service
  • 67. A Python a web service from flask import Flask app = Flask(__name__) @app.route(“/”) def hello(): return “Hello World!” if __name__ == “__main__”: app.run()
  • 68. A Python a web service Werkzeug, Jinja 2 and good intentions
  • 69. A Python a web service Very small and easy to learn (super intuitive)
  • 70. A Python a web service Solid and well documented
  • 71. A Python a web service Awesome and strong community
  • 72. A Python a web service Great debugging tools
  • 73. A Python a web service Application dispatcher (on wsgi level)
  • 74. A Python a web service Integrating unittest and integration tests (also check flask-testing)
  • 75. A Python a web service Signals
  • 76. A Python a web service Configuration == dict
  • 77. A Python a web service Blueprints
  • 78. A Python a web service Response object == wsgi app
  • 79. A Python a web service SHOW ME THE SOURCE YOU MUST
  • 80. A Python a web service BYOB
  • 81. A Python a web service Some batteries Flask-SQLAlchemy Flask-Testing Flask-Oauthlib Flask-Classy Flask-Cache Flask-Script Flask-Principal
  • 82. A Python a web service
  • 83. A Python a web service Q/A
  • 84. A Python a web service Resources Kenneth Reitz Flask Goodness API Driven Development How I develop Things and Why? Kevin Lacker How to Design Great APIs?
  • 85. A Python a web service Thank you! DRINK ALL THE BEERS!