Articles under the category
Debugging Python code

Debugging Python code

Much of a programmer's time is spent debugging code than writing one. While I agree that it's not a great thing, we can't do much about it. But what we can do is maybe make …

  Read more
Enabling tab completion in pdb

Enabling tab completion in pdb

I will admit being a big fan of pdb, and the debugging functionalities it provides. It still could do more by adding tab completion to guess attributes for python objects. In this post, we …

  Read more
Tips for speeding up your Django tests

Tips for speeding up your Django tests

Running tests can become troublesome, if your tests take too long to execute. Ideally, you want an instant feedback from them. Lets us discuss some ways through which we can speed up the run time …

  Read more
Add tests to verify registry of models to django admin

Add tests to verify registry of models to django admin

In the last post, we learned how to automate registration of models to the django-admin. In this post, we will try to see how we can add tests to verify that all our models …

  Read more
Automating registry of django models to the admin

Automating registry of django models to the admin

Registering models to django-admin(in general) is not much of a task, but is mostly boring. Many times it might feel like doing a chore. In this post, we'll try to see how we can …

  Read more
Caching expensive operations in python

Caching expensive operations in python

You have a function that takes a lot of time to execute. You need to call that function frequently, at different points in your code with the same arguments. This expensive function seems to be …

  Read more
Writing unit tests for migrations  in django

Writing unit tests for migrations in django

Writing tests for migration can be a bit tricky because all of your migrations are generally run before any of your test. In case you want to test your code for a particular migration, you …

  Read more
Using watch to monitor output change for a command

Using watch to monitor output change for a command

This is one of the things I wish I knew earlier. There have been a lot of times, where I needed to constantly monitor the output of a command and all I would do is …

  Read more
Use named tuples to stop yourself from remembering order of tuples

Use named tuples to stop yourself from remembering order of tuples

Let's consider an example where you're returning some info about a Person object from a function in the form of a tuple.

def info():
    ...
    return name, address, age

Now, in this scenario the receiving …

  Read more
10 Awesome VS Code shortcuts for Linux

10 Awesome VS Code shortcuts for Linux

Photo by Jessica Lam on Unsplash

In this article I'll share 10 awesome shortcuts for VS Code. These shortcuts are provided by VS Code itself, so you don't have to install any extension for that. …

  Read more