Programming

Python
Python

Latest Blog Articles

routers in Django Rest Framework

routers in Django Rest Framework

Routers are used with ViewSets in django rest framework to auto config the urls. Routers provides a simple, quick and consistent way of wiring ViewSet logic to a set of URLs. Router automatically maps the incoming request to proper viewset action based on the request method type(i.e GET, POST, et...

Read more

viewsets in Django Rest Framework

viewsets in Django Rest Framework

ViewSets are one of the super cool features of  Django REST Framework. ViewSets are just a type of class based view but it do not provide request method handlers like "get()", "post()", "patch()", "delete()", etc. But, it provides actions such as "create()", "list()", "retrieve()", "update()...

Read more

permissions in Django Rest Framework

permissions in Django Rest Framework

Permissions in Django Rest Framework are used to grant or deny access for different types of users to different parts of the API. Permissions are very useful when serving API resources/end-points with certain restrictions. For example,  let's consider you are writing an api endpoint to ...

Read more

authentication in Django Rest Framework

authentication in Django Rest Framework

In previous articles we have developed an open API i.e any user (Authenticated and Un-authenticated) can access the API resource. If we want to want to know the information who is accessing the API then we have to autheticate the user. Authentication means the process or action of verifying the i...

Read more

class based views in Django Rest Framework

class based views in Django Rest Framework

Django Rest Framework supports both function and class based views. I personally prefer class based views upon function-based views. Because most of the common functionality was already implemented in the the class based views. so, why to write it again we can simply use it. It's always a be...

Read more

python exception handling

python exception handling

python exception handling is one of the concepts in python programming. Before start working with exceptional handling in python what is an exception ? An exception is an event which occurs while running the program which stops the program to work further. Exception also tells about the problem i...

Read more

python reading and writing files

python reading and writing files

File reading and File writing is widely used concept in python because, As we (i.e humans) are lazy we do not remember all the information so we invented the computers(i.e storage devices) to store the information. where will computers store the information? Computer always stores the information...

Read more

python writing modules and packages

python writing modules and packages

We basically write computer programs to solve the problems. Problem may be simpler or moderate one or a complex. For simple problems we can solve it with 50 to 80 lines of code. If it is the case then we can easily manage the code. But, if code grows in an amount thousands of lines then obiviousl...

Read more

python staticmethod, classmethod and instancemethod

python staticmethod, classmethod and instancemethod

We have three types of class based methods in python. They are 1.static method, 2.class method and 3.instance method. When we are working with classes we will have to deal with different types of scenarios. Based on the scenario we have to use the one of the method types. Let's get started with t...

Read more

how to add image in select options html

how to add image in select options html

we can add animage in select options in html. but, we cannot directly achieve it with the HTML alone. To display the images in the select drop-down we have to use javascript libraries. We can add an image in select options using "select2" jQuery library.

what select2 can provide us ?

...Read more

django admin custom form usage

django admin custom form usage

Django admin allows us to use custom form. In most of the cases we use default admin provided by django. But, in some cases we may need to use some validations on the model fields or we may want to skip some fields and update these fields while saving it. In this kinds of situations we can solve ...

Read more

Python working with inheritance - oop's

Python working with inheritance - oop's

Inheritance in python defined as acquiring  the properties from the parent/base class to its child classes. In reality we develop complex applications that provides  more utilities to users. In developer perspective each utility involves different modules which work together to provide ...

Read more
Read More Blog Posts