Django + Elastic Search + haystack = Powering your website with search functionality – part 2

posted in: Django | 1

Search is one of the most important and powerful functionality in web applications these days. It helps users to easily find content, products etc on your website. Without search option, users will have to find their way out to reach the desired content which no one likes to do. Just imagine Amazon without search bar, you will have to navigate through various categories to find out the product, and it may take you forever to find it. Having said that, implementing search into your web app is not difficult thanks to lot of libraries built for this purpose. I have broken down … Continued

Django + Elastic Search + haystack = Powering your website with search functionality – part 1

posted in: Django | 1

Search is one of the most important and powerful functionality in web applications these days. It helps users to easily find content, products etc on your website. Without search option, users will have to find their way out to reach the desired content which no one likes to do. Just imagine Amazon without search bar, you will have to navigate through various categories to find out the product, and it may take you forever to find it. Having said that, implementing search into your web app is not difficult thanks to lot of libraries built for this purpose. In this article, we … Continued

Implementing Sitemaps in Django for Dynamic and Static urls

posted in: Django, SEO | 0

Sitemap is a very important piece of information for any website which help search engines index your website. Its a simple XML file having information about all the urls of your website with priority, change frequency and other parameters as well. This helps search engines to learn about the site’s structure and index your website. Generating sitemaps is pretty easy for a static website, there are many online sitemap generator websites available for the same which crawls your website and generates the xml file. You can download and upload this file in the root folder of your website. But this method … Continued

Desktop And Mobile Site With Django | custom render function, no middleware required

posted in: Django | 2

While creating a website, more than 95% sites don’t have separate implementation for mobile site. Ok I made up the 95% number, but you get the idea. Majority of websites rely on responsiveness to look good on mobile device which works pretty well for most cases. However if you want more control over features and styling of your mobile site, then just a responsive version will not work or you have to do lot of media query changes to make it work. Eventually you will realize the need to provide separate implementations for both desktop and mobile devices. This may sound like a lot of … Continued

Optimizing Django ORM Queries for Best Performance

posted in: Django | 4

Django framework already comes with lot of ORM (Object Relational Mapping) functionalities. Once the models are created, you can create, update, retrieve and delete objects using its database abstraction api. Any changes in the models can also be handled using migrations which is pretty awesome. Making queries in django is very simple and straight forward, but it can cause performance issues if the queries are not written properly. Using the techniques listed below, I cut down nearly 92%  database queries and around 80% query execution time. I will show and discuss the statistics in detail below but first lets go through the database … Continued

Architecting Scalable and Fast Asset Delivery System | web server vs cdn

posted in: SEO | 0

Whenever you create a website, you will face the dilemma of how to distribute the content (images, js, css etc) to the end user. Should you use the web-server itself, or use a content delivery network. Delivering content traditionally i.e. from the web-server would deliver all the content from the web-server even if user is across the globe which is a hit on your website load time. Over a past few years, content delivery networks like cloudfare, cloudfront etc have become very popular particularly because of speed, reliability and drop in prices. Delivering 1 gb of content via cloud front … Continued

Django Advanced Tips You Must Know | django, django-decorators, tips, celery, on_delete

posted in: Django | 0

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. It is blazing fast and a very matured framework with all the functionalities you will ever need to create a full fledged website. It’s out of the box admin interface is just amazing. Some of the well-known websites likes Pinterest, Instagram, Disqus, Bitbucket etc are built using django framework. With extensive documentation and active community, you will never get stuck with anything. Although its very easy to get started with django, there are few things which most developers miss out at first and then they have to … Continued

Speed Up Your Website – Django Compressor with S3 and cloudfront

posted in: Django, SEO | 2

In today’s world where the response time of your website determines how many people are going to stay on your website, you cannot ignore the steps needed to improve your website load time. After all, you want your users to get the content as fast as possible, right? And static components of the website are usually one of the bottlenecks and can be optimized to a great extent. There are many ways to optimize distribution of static content, a few of them are Minification (in case of js and css) Gzipping Merging multiple files into one Serving through CDN While top 3 … Continued