Dima Knivets
  • Home
  • Contact
  • About
  • Twitter
solana

What is an account in Solana?

When it comes to Solana development, the concept of account has been the trickiest thing for me to understand. The official docs are good but it was challenging to wrap my head around how it all works without reading sources and asking questions in Discord communities. In this article, I'll
Dec 6, 2021 5 min read
ethereum

How to create and deploy a hello world smart contract in Solidity

After searching the internets, to my surprise, I haven't been able to find an up-to-date Solidity hello world tutorial that would use web3.js and geth to deploy a smart contract. In this article, I'll share the process of creating a simple smart contract, compiling it, deploying it to a
Sep 12, 2021 5 min read
ethereum

How to spin up a private Ethereum node?

In this guide we'll spin up a private Ethereum node, create two accounts, allocate them with funds and make a transaction transferring some ETH between accounts. Why would I want to create a private Ethereum network? I think the main benefit of running a private network is to be able
Sep 8, 2021 10 min read
cbv

3 reasons why you should learn function-based views first

You're fairly new to Django, and there're a lot of unfamiliar concepts you need to wrap your head around. A common source of confusion for beginners is different kinds of views: function-based views, class-based views, generic views. You might be confused about which type of views would be best for
Apr 20, 2020 2 min read
orm

How to use Django with an existing database?

In order to use an existing database in Django, you need to have a model for each table. Creating models for existing tables manually is just too much work. However, there's no need to do that, since Django has a builtin tool to solve this exact problem. Note: this guide
Oct 23, 2019 2 min read
OpenAPI

Django Rest Framework OpenAPI 3 support

OpenAPI 3 support in Django Rest Framework is still a work in progress. Things are moving quickly so there's not a lot of up to date info about this topic. It's not clear which features of OpenAPI 3 spec are supported in DRF and researching this info on your own
Aug 20, 2019 7 min read
Webpack

How to configure Hot Module Replacement (HMR) with django-webpack-loader

It is very frustrating to reload your Django website manually each time you make a change to the frontend code. In addition to performing an extra action every time you change something, you also waste a lot of time by waiting until your whole website reloads. Thankfully, Webpack has a
Aug 8, 2019 2 min read
OpenAPI

How to generate an OpenAPI spec in Django Rest Framework?

There are two ways to generate an OpenAPI spec in Django Rest Framework: CLI command and API endpoint. How it works The actual spec is produced by an underlying generator class, called by either a CLI command or an API endpoint. Long story short: generator collects the project endpoints from
Jun 16, 2019 1 min read
What is the difference between CoreAPI vs OpenAPI?
OpenAPI

What is the difference between CoreAPI vs OpenAPI?

OpenAPI OpenAPI is a specification used to describe API services. It is also known as a Swagger specification. It is used by various languages and frameworks as a format to describe API services. OpenAPI specifies how to produce a document which is supposed to be a textual representation of your
Jun 15, 2019 1 min read
Integrating Django i18n with Jinja2 and Vue.js

Integrating Django i18n with Jinja2 and Vue.js

It is trivial to add translations to a Django project that uses built in Django templates, however if you're using other template engines like Jinja2 it might take some effort to make those two work together. Things can get tricky if you want to manage translations for both the frontend
Mar 25, 2019 8 min read
3 ideas to optimize the Django ORM performance

3 ideas to optimize the Django ORM performance

Indexes Django ORM creates indices for primary and foreign keys out of the box. However, if you perform a lot of queries on the rest of the columns (the columns that are used in a filter() [https://docs.djangoproject.com/en/2.2/ref/models/querysets/#filter] method) it makes
Mar 14, 2019 1 min read

Should I be familiar with databases when working with Django?

One can definitely build apps with Django without any particular database knowledge. However, some of the problems can be solved more easily when you know how to work with a database. Here are a few example of things to know in order to work with a database effectively: * how to
Mar 12, 2019 1 min read

Why should I use Django ORM when I know SQL?

The main benefits of using Django ORM instead of SQL is a huge improvement in development speed, code maintenance, security and ease of development in general. Let’s talk about these in detail. Development speed Django ORM comes with a lot of built-in tools that speed up the development process
Feb 5, 2019 1 min read

How to create file download links in Django?

In order to create a download link, we need to create a Django view that would serve the files: # views.py import mimetypes ... def download_file(request): # fill these variables with real values fl_path = ‘/file/path' filename = ‘downloaded_file_name.extension’ fl = open(fl_path, 'r’) mime_type, _ = mimetypes.
Sep 24, 2018 1 min read

JavaScript, Django and PostgreSQL timezone handling

Please have a look at the first part, which covers date, time and time zone basics in detail. This is a post about timezones issue I’ve been working on at DjaoDjin. Imagine there is a company with multiple teams distributed across the globe. They are all accessing the same
Apr 17, 2018 10 min read

Working with time in Python

How is time measured? Time is usually measured by earth rotation or by astronomical observations. There are a lot of standards [https://en.wikipedia.org/wiki/Time_standard] which specify how this should be done exactly: GMT [https://en.wikipedia.org/wiki/Greenwich_Mean_Time], UT [https://en.wikipedia.org/
Apr 11, 2018 6 min read

How to increase the open files limit on Ubuntu?

Increasing file limits might be helpful if you’re running a web server which handles a lot of concurrent connections, because every connection opens a socket and socket is a file. In my case, I needed to increase the open file limit from 1024 to 65536 to make sure that
Mar 8, 2018 3 min read

What is the point of using NGINX in front of a Django application?

Recently, a friend of mine asked me to tell him more about the rationale behind using NGINX with a Django app and how these two work together. It actually makes perfect sense for someone to raise this question: Python has a builtin web server which can render pages, serve static
Feb 5, 2017 4 min read

Crawling pages with Scrapy

Scrapy is a powerful library used to build crawlers, scrapers and parsers. It is built on top of Twisted which means that under the hood the networking operations are asynchronous which improves the crawling performance significantly. I’m going to describe the essential Scrapy parts that are usually used when
Dec 28, 2016 4 min read
Page 1 of 1
Dima Knivets © 2025
Powered by Ghost