24 Apr 2019, 20:36

Deploy Django Application in Sub Path Using Openshift
The Problem When you are using Openshift, you will be using routes to expose a route from a service. Let’s say you want to expose a path in example.com/dummy. When you do that for a django application(without any reverse proxy server), it usually becomes a problem, because the sub path does not work well with Django’s urls.

19 Apr 2019, 23:59

Install MySQL and MySQLClient(Python) in MacOS
Connecting to MySQL from Python in MacOS is a very problemtic and painful process. In this post, we are going to see how to install MySQL and connect it from a Python Application using mysqlclient: Step One: Install Brew You need to install Homebrew in you local machine. You can do it by:

12 Apr 2019, 01:06

Create Proxy Object in Python
Lets say you have been using a class named ClassA, objects created from that class has been used in many places. Now you have a requirement that you need to make a simillar class ClassB, which has almost simillar functionality. Objects of ClassA and ClassB will have simillar method signatures, and could be swapable.

06 Apr 2019, 01:49

Do Extra in S3 Using Django Storage and Boto3
Today, I am going to write about few useful snippets/functionalities which I have used for Amazon S3 or any S3 compitable storage using Boto3 and Django Storage. FYI, this post focuses on using S3 with Django. So without further ado, lets begin: Configuring S3 When using django storage, you don’t need to put configurations like ~/.

10 Feb 2019, 00:38

Django: Save Unknown Object in Database
Suppose you are dealing with a poorly written API, which returns different type of objects at different scenarios. For example, sometimes it returns a string(ie. abcd), sometimes it returns a list(ie. [1,2,3,4]), or maybe None. Now, you are suppose to save that data, which you can’t predict. As you can’t predict the data type of object, you can’t design your Django Model accordingly.

26 Jan 2019, 14:58

Django: Custom Ordering/Grouping for Model Instances Using Linked List
Linked list is a data structure where each object has points to next. In django, linked list can provide an interesting solution when it comes to custom ordering/grouping issues. Lets think of an example like this: you are making a blog site, and you have made a Post Model like this:

03 Jan 2019, 02:00

Django: Changing User Model in Mid-Project
Every now and then I see some questions pop up in stackoverflow with title: ValueError: Related model ‘app.User’ cannot be resolved This is a very common issue and pops up when the user tries to run the migration. So, lets talk more about what is this problem and how can we solve it.

22 Dec 2018, 02:00

Testing for Django Rest Framework with Factory Boy and Faker
“I’m not a great programmer; I’m just a good programmer with great habits.” ― Kent Beck Test Driven Development - in short TDD is a practice where you write the tests first then the actual code. It makes the code less vulnerable and it makes a testable software rather than writing the software, then test it.

21 Dec 2018, 23:00

Bye Bye Ghost, Hello Hugo
“The Only Thing That Is Constant Is Change -” ― Heraclitus This blog site has changed quite a lot since the begining. I initially developed it as a Django application. It was part of my learning process, and I hosted it in a private shared server. But unfortunatly, good days came to an end, I had to give up that hosting for costing.

12 Oct 2018, 17:25

Control Application Flow from Redux Middleware using React Router 4
While developing application in ReactJs with Redux and React Router 4, what I felt is that, there is no direct relationship between application’s state and routing. We needed to create those connections inside Components. In each component, we needed to check application state and based on that we made decisions where to go next(if needed).