Software engineering facts, information, and skills categorized as Python

Install specific git commit with pip

Varghese Chacko 1 year ago

To install specific git commit with pip,  You can specify commit hash, branch name, tag.

Categories:
Python

What is @permalink and get_absolute_url in Django?

Varghese Chacko 1 year ago

What is @permalink and get_absolute_url in Django? When and why to use it?

Categories:
Django Python

How to install Python package from GitHub?

Varghese Chacko 1 year ago

How to install Python package from GitHub?

Categories:
Python

Get the previous months name

Varghese Chacko 1 year ago

Often we need to get previous months name in python, especially, when we have to save report from previous month's name. In python its is pretty simple. 

Categories:
Python

Get month name from month number

Varghese Chacko 1 year ago

How can we get the month name from the month number? For instance, if I have 3, I want to return march? Most simple method is to define a function that checks for the number and return name.

Categories:
Python

Clone a sqlalchemy db object with new primary key

Varghese Chacko 1 year ago

At many points, a developer may want to clone a row of data for multiple reason. TheSQL Alchemy makeit easy to do in 5 steps. For example we have a table products and clone the product with id 25.

Python - Delete item from array by its value

Varghese Chacko 1 year ago

Python logoOften we encounter the situation where we need to remove item from array by value. For example, if we have an array [23, 1, 54, 32, 34, 8, 23]. We don't know or we are not sure about the index of the value 32, but we need to delete it. Python array has the built in function remove. For example

Configure Amazon S3 for Mezzanine - a Django Blog engine

Varghese Chacko 1 year 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 1 year 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