Slide 1

Slide 1 text

micro web frameworks pl. mikrołebfrejmłorki in

Slide 2

Slide 2 text

mikrołebfrejmłorki

Slide 3

Slide 3 text

mikrołebfrejmłorki

Slide 4

Slide 4 text

• HTTP • routing • templates • configuration • ORM web framework we

Slide 5

Slide 5 text

• HTTP • routing • templates • configuration • ORM web framework but

Slide 6

Slide 6 text

• few lines of code • few dependencies • small memory footprint • application in a single file • framework in a single file „micro” web framework additional

Slide 7

Slide 7 text

• few lines of code • few dependencies • small memory footprint • application in a single file • framework in a single file „micro” web framework this

Slide 8

Slide 8 text

„micro” web framework • Flask • Bottle • web.py single

Slide 9

Slide 9 text

„micro” web framework • Flask • Bottle • web.py • Django single

Slide 10

Slide 10 text

„micro” web framework • Flask • Bottle • web.py • Django 5922 2722 6610 72790 lines

Slide 11

Slide 11 text

„micro” web framework • Flask • Bottle • web.py • Django 2132 2722 6575 69399 3790 0 35 3391 test

Slide 12

Slide 12 text

# ls django ! bin conf contrib core db dispatch forms http middleware shortcuts template templatetags test utils views what

Slide 13

Slide 13 text

„micro” web framework • Flask • Bottle • web.py • Django 2132 2722 6575 24731 3790 0 35 3391 0 0 0 44668 test

Slide 14

Slide 14 text

# Flask? ! itsdangerous markupsafe werkzeug jinja2 but

Slide 15

Slide 15 text

„micro” web framework • Flask • Bottle • web.py • Django 20124 2722 6575 24731 3790 0 35 3391 0 0 0 44668 17992 0 0 0 test

Slide 16

Slide 16 text

app in a single file? Django

Slide 17

Slide 17 text

from django.conf import settings ! if not settings.configured: settings.configure(DEBUG=True, DATABASES={}, ROOT_URLCONF='app', INSTALLED_APPS=[], MIDDLEWARE_CLASSES=[], TEMPLATE_DIRS=['templates']) put

Slide 18

Slide 18 text

from django.core.wsgi import get_wsgi_application application = get_wsgi_application() ! if __name__ == "__main__": import sys from django.core import management management.execute_from_command_line(sys.argv) create

Slide 19

Slide 19 text

from django.core.wsgi import get_wsgi_application application = get_wsgi_application() ! if __name__ == "__main__": import sys from django.core import management management.execute_from_command_line(sys.argv) NOTE:

Slide 20

Slide 20 text

56 LOC 17 Django „boilerplate”,

Slide 21

Slide 21 text

• few lines of code ✔ • few dependencies ✔ • small memory footprint ✔ • application in a single file ✔ • framework in a single file „micro” web framework look

Slide 22

Slide 22 text

Django == best \ mikrołebfrejmłork

Slide 23

Slide 23 text

Marek  Stępniowski @mstepniowski