This is the second part of our small tutorial on how to build a very simple API in Django and djangorestframework through TDD. In the first part, we implemented our model then tested it against a few test cases and it worked.
In this part we will focus on the three endpoints we defined in the first part. Let’s start by theoretically define what we need to have functional API endpoints:
TDD stands for Test Driven Development which is a software development process relying on software requirements being converted to test cases before software is fully developed. This is opposed to software being developed first and test cases created later. — Wikipedia
The large majority of independent software developers — that includes me — do not write tests for one reason or another. Whenever I was building a simple REST API or any application I reckoned spinning up Postman or the browser to test your endpoints was just enough for me to validate the functionalities.
After years of taking the same…
Given the on going circumstances, Digital transformation has become the De facto resolution to almost every organizations around the world — regardless of their size.
We all know how tough of a job it is to plan, develop and deploy a digital project. It gets even more difficult when the company has to run on limited resources.
This piece highlights a few steps every solution analyst should know before taking on any digital transformation projects. It can be applied to literally any digital project implementation in the broader sense.
To identify the need for improvement, the customer has to answer…
OCR basically stands for Optical Character Recognition/Reader.
“It is the electronic or mechanical conversion of images of typed, handwritten or printed text into machine-encoded text, whether from a scanned document, a photo of a document, a scene-photo or from subtitle text superimposed on an image and it is one of the applications of computer vision”. — Wikipedia
To make it simple, it is a technology that lets you convert whatever file that contains some text to be processed in it — whether a JPG or PDF format — into a machine-encoded text so you can edit, append or deduct whatever…
This is the second part of how to generate barcodes using the Django Web framework.
This part will focus on importing a list of customer name from an excel or CSV sheet. By default, the generated barcode in Part 1 is in PNG format; we need to change that as well to a PDF format so they can be easily printable, this will be the subject of a third and final part.
Bear in mind that I’m not a great UI guy so, we will do just the minimum required for the display. We’re going to split this piece into…
Currently working with an Enterprise Solutions that serves as a CPR (Capture Process Route) tool for increasing knowledge workers productivity by at least 50%, if your workflow includes storing digital documents in different locations day in and day out. It has some quite outstanding features under its belt and the one I am trying to use right now is batch scanning through barcodes.
What this feature does is, it scans a load of paper and automatically groups them based on their appropriate destination. Generally speaking, the process of going from paper to electronic documents is often cumbersome, especially when it…
Times of making old fashion boxes have come to an end.
I remember my time in India, I didn’t have a personal printer so I had to go to an internet cafe in order to make prints or copies of a document. Somehow the expression we used was always “I need to make a xerox ”, though the printers used were Canon or HP branded.
It was only years later, after working with a Xerox Partner that I came to understand we were referring to the Xerox Corporation because they are in a sense the pioneer of modern printers. In…
Handling objects creation the easiest way possible.
It’s been quite some time that I play with Django, a couple of years to say the least and this is in my opinion one of the most overlooked methods by new Django developers.
Speaking of my own experience, I remember when I just started programming, my code had to be pretty thick and complex otherwise I wouldn’t be happy with it and I wrote a story on looking back at my 1st GitHub repo that is the perfect illustration of it.
Anyway, “ Revenons à nos moutons ”! As I was saying…
Let’s talk about context processors and see how you can use them effectively in your Django projects.
“A context processor has a simple interface: it’s a Python function that takes one argument, an HttpRequest object, and returns a dictionary that gets added to the template context. Each context processor must return a dictionary.
Custom context processors can live anywhere in your codebase as long as they are pointed to by the context_processors argument of Engine.” — Django’s documentation
When working with multiple and separate
views, you may load different data objects into different views, but sometimes the use case requires…