Image source: here

Probably, Django developers are the happiest ones, because Django itself provides an admin panel and saves developers from the waste of time. But in some cases, we at least want to change the theme or even the entire design of the admin panel, add a Google Analytics dashboard, and so on.

Instead of coding and wasting time to change the design, we can easily add themes and new features to our admin panel only by installing some ready packages and integrating them into our projects by doing some simple configurations

In this case, we’ll look through the django-jet-reboot package

Let’s…

Image source: here

Sometimes we need to execute one-off tasks. For example: change something from the database automatically, send reports or notifications, schedule some tasks, and so on. If you want to call these commands whenever you want then management commands are the best choice. You can even use management commands as workers in production. Django itself has several commands such as migrate, makemigrations, runserver, and so on. Now I will show you have to write your own management command. Let’s begin!

Project Structure

I assume you already have a ready Django project called “my_project” and an app called “my_app”. Go inside this app, and…

Image source: here

Hello. In this tutorial, we will learn how to create a simple echo bot in python with some Scheduled tasks. Let’s begin!

Dependencies and First Steps:

There is a list of all dependencies you should have for this tutorial:

  1. Python
  2. Telegram account
  3. python-telegram-bot module

Probably, you already have the first 2 dependencies, so let’s begin with the installation of the module. Open terminal and type this command:

pip install python-telegram-bot

Then we have to create our bot and get the token from Telegram. For that open telegram and search for “BotFather” (“@BotFather”). Choose the verified one. …

Source of the image: here

Hello. In this article, we will talk about Python Decouple and its benefits. We will use it to store sensitive data of our project. You may think that we can just use environment variables, but I will show you why Python Decouple is a better choice.

Let’s begin!

Although Python Decouple firstly was designed for Django, it became an independent tool for separating settings from code and now you can use it in all python projects.

Why use it?

All projects (even open-source projects) may have sensitive data that you do not want to share with anyone. The data could be the email host, email…

Sometimes some newbies think that it is not possible to deploy single script on any server and we must have bunch of settings in order to hosting something. But obviously that is not true, and all that we need there are only requirements and Procfile files ( and our script, of course :d).

So lets begin to deploy our script. There are several ways to deploy files on Heroku such Heroku — cli and using GitHub. In this tutorial we will use GitHub.

Dependecies

There is a list of things you need in for this tutorial:

  1. GitHub account
  2. Heroku account
  3. Heroku-cli

In this article we will learn how to handle errors like HTTP 404 “Not Found” and 500 “internal server error”s. When these errors occur, the web server will automatically show the special pages created for these cases. Let’s begin.

Step 1: Change debug to false

Filename: settings.py

To see the pages we created for these errors we change Debug to false. Also you have to do that before deployment

DEBUG = False

Step 2: Create HTML template

Go the directory where your templates are located and create html pages for each error. In this case I will do it for 2 errors

Let’s create 404.html and 500.html pages like this:

404.html:

Rafael Salimov

Student, Blogger and finally a Web Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store