Talk about technologies

Top Python Interview Questions

Today Python is a very popular language. It is very easy to understand and learn. And there are lot of jobs on python in the market today. It is not limited to a particular domain, it can be used as web programming language, system programming, data analysis, and even the Machine learning and the Artificial Intelligence using python is very popular in the market. Python has very big community and support on these domains. Now If you are going to use the Python as a web programming language. I am going to post the most commonly asked python interview questions. What is Python Python is a general purpose high-level programming language generally used for the web development, and system programming. It supports both the OOPS as well as the procedural, and functional programming paradigm. It is very simple, easy to understand and learn. It is the interpreter based programming language. What are the features of Python Features of python include:- python supports both the functional and the structural programming paradigm python syntax is easy to understand and learn automatic garbage […]

Multi Tenant Application using Django – Connect and manage multiple databases to the single application

     Today I am going to talk about multi-tenancy. What is multi-tenancy and how to make a multi-tenant architecture based application. Multi-tenancy refers to single instance of the application which server multiple tenants. Tenants refer to the group of users who have common access with specific privileges to the software resource. Suppose that there is a simple application connected to the multiple databases, and each database belongs to the specific users or tenant. Today, I am going to show you how to make a Django Applicaion connect to the multiple database, switching the databases at run time, get data from the multiple databases and also managing the django admin of the each database site. By the database site we refer to the URL where particular database can be managed. Each database has its own corresponding URL or site, eg: testdb1 has admin uri say – http://localhost:8000/testdb1_admin/ or testdb2 has admin uri say – http://localhost:8000/testdb2_admin/. If you are only interested in the source code, it is hosted in my github account here – To set up the project:-

     In the […]

Integration of Elastic Search and Django(A Python Framework) – Part three

In the previous tutorials I made a simple django application, and made a custom command(seed_db) that populate the database with the dummy data, also take count as argument of how many products will be created. Now In this tutorial we will learn, how to index our database with the elastic search. Elasticsearch, in simple words it is like a search engine provide capabilities like full text searching, filtering, faceting and many more with fast speed on non relational JSON like documents. So its like a private search for your web application. Upto this level we had a simple django based application consist of the five models, one is built in model, i.e. User model from django.contrib.auth.models, others are Product, Category, Subcategory and the UserProfile model. We also implemented a custom command to populate database with the dummy data. So we can have any number of dummy records in our db, to make it indexed in elasticsearch. So thats the reason to make seed_db command. Now I am going to make one more custom command i.e. index_db, to index the database […]

Integration of Elastic Search and Django(A Python Framework) – Part Two

In the previous tutorial I made a simple django application, now in this tutorial I will make a custom command that will populate the database with the dummy data. We will use extra modules of the django listed as follows:- Model Mommy Faker django-extensions activate the virtual environnent

install model mommy

same, install faker

install django-extensions

add django_extensions to the Installed apps in the Make a sample command

This will make a folder management with the sample command ( in the core folder. Rename this file to say Update the code of the file as:-

As you see in the above code its is a simple python code to generate the dummy data. I used django-extensions for making the sample command like this one seed_db. model_mommy to prepare and create the objects in the database and faker to generate fake data, like names, email etc. To populate db, save this command file and run the command:-

100 is the argument as I want to make 100 dummy products. you can […]

Show Buttons
Hide Buttons