Latest Blog Articles

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

inheritance in python oops

inheritance in python oops

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

how to add custom views to django admin

how to add custom views to django admin

how to add custom views to django admin without actually creating the database table ? Let's talk about it. In django admin  to get the url link in the admin we have to register the model but in some cases we just need the a url with some functionality under an applicaiton. We can imple...

Read more

method overloading in python

method overloading in python

method overloading in python can be defined as writing the method in such a way that method will provide different functionality for different datatype arguments with the same method name. Programming languages like Javaand C++ implements the method overloading by defining the two methods with t...

Read more

'__enter__' and '__exit__' context managers in python

'__enter__' and '__exit__' context managers in python

__enter__ and __exit__are built in methods in python. __enter__ and __exit__ methods are also called as context manager special methods in python. You may come up with the question"what is a context manager ?". A context manager is a manager which has the ability to make avail the data withing ...

Read more

model serializers in Django Rest Framework

model serializers in Django Rest Framework

Model serializers in django rest framework are very similar to the django model forms. By using the model serializers we can reduce the effort of writing the more code for serializers. Model serializers are the shortcuts that allow us to automatically create a serializer with fields that associat...

Read more

object oriented programming in python

object oriented programming in python

Object oriented programming is one of the programming approaches in solving the problems with progamming. Python supports object oriented programming(OOP) approach. While using OOP's in  python we mostly use terms like object, class, method, etc.

Some of the principles of Object Orie...

Read more

working with select_related in django

working with select_related in django

select_related is a queryset method in Django which returns new queryset result for a Django Model. select_related is more helpful in foreign-key relationships. It is useful when we are going to use those foreign-key relationship data later in our code.  select_related is a preformance ...

Read more

using custom widgets in django

using custom widgets in django

In Django we use built-in forms. After rendering the template with form and form fields we can see the equivalent html is generated from the form fields. How Django is doing that ? Well, to generate HTML from the form fields django uses form Widgets. In some cases we need the some specific HTML f...

Read more

Allow remote connections to PostgreSQL

Allow remote connections to PostgreSQL

Working with the PostgreSQL in server is fine. But, sometimes we need to access the server or cloud database from our local machine. But, when we try to connect to the PostgresSQL server database from local it will not connect. Because, by the default configuration PostgreSQL only allows host "lo...

Read more

serializers in Django Rest Framework

serializers in Django Rest Framework

Serializers in django rest framework are similar to django forms. By using django rest framework serializers we can serialize and deserialize the data. We can also validate the incoming data using django rest framework serializers to maintain the integrity of the data. We can divide the django re...

Read more

how to add swap memory in ubuntu

how to add swap memory in ubuntu

In every computer we have a physical memory(i.e: RAM). When a user starts a program it is loaded from the disk (where the program resides) to the RAM, because RAM is faster than the disk memory. Some processes intially need more memory to startup but after it will not use the complete memory that...

Read more

working with supervisor on ubuntu

working with supervisor on ubuntu

In most of the ubuntu virtual private servers it is often case that we will have to run several small programs continuously. The most traditional way to do it is to write a init script in for the program that we want to run continuously. But it is a time consuming process to manage it.

Supervi...

Read more

how to use templates in django

how to use templates in django

Django is a webframework so, It needs to maintain the code in such a way that it should be easy to navigate and easy to read and maintain. As we already know the Django framework is a MVC, we do not write the HTML code in the views.py instead we write it in a template. In django web fra...

Read more
Read More Blog Posts