Configure Amazon S3 for Mezzanine - a Django Blog engine

Varghese Chacko 3 years, 3 months ago

Amazon S3 is an efficient static file storage system for its services and relatively cheap. On the other hand Django is a nice web development framework that doesn't like to handle static files. Mezzanine is a popular blog engine  built in Django. Since Django doesn't like to handle static files on production systems, we always have to configure a web server like nginx or apache webserver to serve static files. On the other hand, its easy to host static files to Amazon S3. The S3 configuration for static files is easy, but saving user uploaded files for Django web app may raise some permission issues. Here is how we have configured the Django-S3-Mezzanine blog.

Python for engineering your Internet of Things (IoT) Application framework

Varghese Chacko 3 years, 3 months ago

Python logoPython has already gained it's momentum among IoT developers as it offers readability with syntax without compromising on syntax. In today's era, language doesn't really matter any more when it comes to IoT, ease of writing the code efficiently matter. Large number of available open-source libraries and ability to get more things done with fewer lines of code is an added plus. Python's clean syntax and one to one mapping of it's data built-in structure -dict- to JSON are added advantages. If your application works with database or communicates with JSON data, Python is the right choice. Python is the choice of language for Raspberry Pi, one of the most popular micro controllers in the market. The micro Python is another micro controller optimized for using Python. Few of the advantages of using python includes

Python sort list of dict by calculated value

Varghese Chacko 3 years, 3 months ago

We often needto sort a list of dictionaries by calculated value. Python's sorted is very powerful so that it can do literally anything with custom key function Assume that we have a list of 20 students with their name and marks. Wedont have the total of their marksin the list. We want to sort them by rank, ie descending order of total marks.

Python sort array of dictionaries by value in the dictionary

Varghese Chacko 3 years, 3 months ago

One of the cases we face in programming is sorting an array of dictionaries by value in the dictionary. In Python, it is possible to write a one-liner to achive the same. Suppose we have a list of dictwith name and age of students in a class.

Python sort dictionaries(dict) by key or values

Varghese Chacko 3 years, 3 months ago

Python dictionaries are  key-value pairs. Some times we need to sort the dictionary by key or by value. In both cases we can do it by using the built in sorted function.

Python sort arrays in place with built in sort() method

Varghese Chacko 3 years, 3 months ago

Python provides two methods to sort an array. First one is list.sort() which sorts the array in place where as sorted returns the sorted array and will not change the original array. 

Create sitemap using Django sitemap framework

Varghese Chacko 3 years, 3 months ago

The django sitemap framework is very flexible. We can use it to create sitemap for any item in thedatabase, along with custom configurations. The very basic step is to add django.contrib.sitemaps to the installed apps. Then it is better to have our own sitemaps.py. In the sitemaps.py, we have to create a class by inheriting the class Sitemap from django.contrib.sitemaps. In this class we can define our properties for entries in the sitemap.

Create sitemap for static pages in Django application

Varghese Chacko 3 years, 3 months ago

We have both static and dynamic pages in a Djangoapplication. How will we add static pages to stitemap? It is very siple. As first step, we have to include 'django.contrib.sitemaps' to the installed apps.

Create sitemap for Django application via sitemap framework's GenericSitema...

Varghese Chacko 3 years, 3 months ago

Sitemaps are very critical for SEO. For a Django application, how can we add sitemap? The django applications has dynamic content and it is almost impossible to recreate a sitemap and upload to the site. The django sitemap framework is for our rescue.

Let us talk!

We take the vision which comes from dreams and apply the magic of science and mathematics, adding the heritage of our profession and our knowledge to create a design.