Programming

Python
Python

Frameworks

Django
Django
Django REST Framework
Django REST Framework

Latest Blog Articles

django pass data from view to template

django pass data from view to template
As we know django is a MVC framework. So, we seperate business logic from presentational logic. We write business logic in views and we pass data to templates to present the data.

Read more

renderers in Django Rest Framework

renderers in Django Rest Framework
Renderers are used to serialize the response into a specific media type like JSON, XML, YAML, etc. Django REST Framework provides various built-in renderer classes and it also supports to write a custom renderer. We specify renderers as an iterable type (i.e tuple, list, set, etc.). It means we can use multiple renderers for a single view/viewset.

Read more

parsers in Django Rest Framework

parsers in Django Rest Framework
Parsers in Django REST are used to parse the content of incoming HTTP request. In HTTP request we recieve the data as a string format. Parsers will parse the HTTP contetns in to python data types based on the Content-Type header recieved in the HTTP request. Django REST Framework provides a number of built-in parsers which parses different types of

Read more

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, etc). Let's start using routers. Working with DRF Route

Read more

django send email using mailgun api

django send email using mailgun api
We can send email in django using mailgun api. Mailgun is one of the trusted email service providers. When we send email using the mailgun it can directly deiver it to the recipient. As it is a trusted email service provider our email cannot be spammed. So, our information can be reached to the end user. By using mailgun we can send upto 10,000 ema

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()", "partial_update()" and "destroy()". DRF allows us to com

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 create an answer to a question just like stackoverflow. It only

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 identity of a user. REST framework provides a number o

Read more

advanced class based views in Django Rest Framework

advanced class based views in Django Rest Framework
Django Rest Framework is super awesome to create an web API very quickly. It provides generic views to implement the common functionality. In the previous section we have discussed about class based views in Django REST. Django REST class based views allows us to create an api endpoint with a single request method type i.e one of "GET", "POST", "PU

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 better approach to keep our code DRY. In DRF we have a class

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 in the code execution. We can write our own exception.

Read more

tmux working with split terminal

tmux working with split terminal
Tmux is a terminal multiplexer for linux systems. Tmux allows multiple terminal sessions can be accessed within a single window. Tmux is used for running more than one program in the same terminal at the same time. We can also use it to detach processes/programs from their controlling terminals. Tmux allows SSH sessions to remain active without bei

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 in files. Hence, As we programmers we have to learn

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 obiviously it will be very difficult to maintain that code. So

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 these python methods. Python Static Methods In python

Read more

Read More Blog Posts