Ath Tripathi has Published 78 Articles

Django – Handling multiple forms in single view

Ath Tripathi

Ath Tripathi

Updated on 26-Aug-2021 11:53:23

5K+ Views

We sometimes need to handle multiple forms in a single function or view. In this article, we will see how to write a function which will handle two forms at the same time and in same view. It is handy in many cases; we will handle more than two forms ... Read More

Enabling GitHub OAuth in Django

Ath Tripathi

Ath Tripathi

Updated on 26-Aug-2021 11:39:17

551 Views

In many developer websites, we get to see GitHub social authentication which is very handy. In this article, we will see how to add Github Auth in our Django website.Go to https://github.com/settings/developers/ and create an Oauth application and add these two URLshttp://127.0.0.1:8000/http://127.0.0.1:8000/accounts/github/login/callbackThen, you will get a Client ID and a ... Read More

Getting POST request IP address in Django

Ath Tripathi

Ath Tripathi

Updated on 25-Aug-2021 13:21:39

814 Views

In this article, we will see how to get the IP address of from where we get POST request. It is sometimes important to keep a check on the security parameters. Sometimes you might need to ban some IPs or you might need to check if anyone is sending too ... Read More

Form widget in Django

Ath Tripathi

Ath Tripathi

Updated on 25-Aug-2021 13:19:32

848 Views

In this article, we will see how to use widgets in a Django form. Widgets can be quiet helpful to make the frontend better. Widgets are html elements that are rendered from Django form, textarea, input, password input, etc., all are widgets.First let's create a Django project and an app. ... Read More

Exporting models data in Django

Ath Tripathi

Ath Tripathi

Updated on 25-Aug-2021 13:15:26

627 Views

   In this article, we will see how to export model data in .csv format. Sometimes, you might need to export your model data in different formats such as .csv or json or .xlsx for further work or reporting. You can do this by making some sort of script but ... Read More

Django runtime system check

Ath Tripathi

Ath Tripathi

Updated on 25-Aug-2021 13:12:21

232 Views

While creating a Django website, sometimes you want a URL endpoint from where you can check your database, cache, and storage. In such cased, we can use a third-party package to keep a check on your system performance and other things and you can check your system even in production.In ... Read More

Django rest-framework JWT authentication

Ath Tripathi

Ath Tripathi

Updated on 25-Aug-2021 13:11:15

1K+ Views

If you ever worked with Django REST framework, then you surely know about JWT authentication. JWT authentication is used for token authentication and it is really a popular method for authentication in Django. JWT stand for JSON Web Token. Let's see how to work with it.First, install a package −pip ... Read More

Django query count in terminal for debugging

Ath Tripathi

Ath Tripathi

Updated on 25-Aug-2021 13:09:29

461 Views

In this article, we are going to use a library in Django to see a brief report of database query count in terminal which can be used for debugging. It will provide a brief tabular report of every hit on any model object and print it on every hit, whether ... Read More

Django model object hit counting

Ath Tripathi

Ath Tripathi

Updated on 25-Aug-2021 13:06:04

373 Views

In this article, we are going to make a project in which we will see how to make a Django table that will store all the data of hit count and detailed data of hit. It can be used generate useful reports. So, let's get started.Setup your urls.py and install ... Read More

Django model data to JSON data in 2 lines

Ath Tripathi

Ath Tripathi

Updated on 25-Aug-2021 13:04:38

2K+ Views

In this article, we are going to learn a handy trick to convert Django model data directly to JSON data. Sometimes, we need to return model data in JSON format; it can also be used in making API or just showing simple data to our frontend in JSON format. JSON ... Read More

Advertisements