4. “(...) a set of dedicated URLs that return pure
data responses — meaning the responses
won’t contain the kind of presentational
overhead that you would expect in a
graphical user interface like a website.
Petr Gazarov
https://www.freecodecamp.org/news/what-is-an-api-in-english-please-b880a3214a82/
7. The Code-First approach
Install Django
It’s not up to decision
picking a different
framework ❤
Design the
database
Come up with
diagrams, define the
indexes, describe
relationships 💾
8. The Code-First approach
Install Django
It’s not up to decision
picking a different
framework ❤
Design the
database
Come up with
diagrams, define the
indexes, describe
relationships 💾
Write the code
Organize the packages,
do some TDD, write the
models, the views,
perhaps some API 👨💻
9. The Code-First approach
Install Django
It’s not up to decision
picking a different
framework ❤
Design the
database
Come up with
diagrams, define the
indexes, describe
relationships 💾
Write the code
Organize the packages,
do some TDD, write the
models, the views,
perhaps some API 👨💻
Deploy &
release
Deal with CI, CD, PaaS,
provisioning,
monitoring, caching,
etc 🖥
10. The Code-First approach
Install Django
It’s not up to decision
picking a different
framework ❤
Design the
database
Come up with
diagrams, define the
indexes, describe
relationships 💾
Write the code
Organize the packages,
do some TDD, write the
models, the views,
perhaps some API 👨💻
Expose
Let other stakeholders
know about your
release 🎉
☝
Here is where we’ll
start to integrate with
other developers
Deploy &
release
Deal with CI, CD, PaaS,
provisioning,
monitoring, caching,
etc 🖥
11. “Today Django is arguably used more often as
just a back-end API rather than a full
monolithic website solution at large
companies!
William S. Vincent
Django for APIs
13. “(...) the first, most waterfall aspect of
application development is the design of the
API’s.
Casey Lutz
https://medium.com/trimble-maps-engineering-blog/api-first-development-and-openapi-83
5afb46b7f1
20. Design the API
Understand the
requirements, know your
stakeholders, set standards,
start defining behaviours.
API Blueprint example 👉
20
21. Validate
Get stakeholders involved,
think about use cases,
validate ideas through mock
servers, and get an
agreement.
Or you can use Prism:
https://stoplight.io/open-source/pris
m/
21
23. Implement
It’s time for some coding.
And it’s not just you! With a
solid contract your
stakeholders can start the
development as well.
Django REST Framework example 👉
23
26. It’s official!
It’s time to turn the
agreement into a
specification.
rest_framework (with
uritemplate and pyyaml) is
enough to do this job.
26
$ python manage.py generateschema >
openapi-schema.yml
27. How to deal with changes?
▷ Path: mytodoapp.com/v1/tasks
▷ Querystring: mytodoapp.com/tasks?version=1.0
▷ Host: v1.mytodoapp.com/tasks
▷ Accept header: Accept: application/json; version=1.0
▷ Custom header: X-API-VERSION
▷ No versioning at all 🙃
https://www.django-rest-framework.org/api-guide/versioning/