Found 51 Articles for Django

How to change password of users in Django?

Gayatri Jandhyala
Updated on 05-Sep-2022 11:03:28

4K+ Views

Static and dynamic websites are the two types of websites widely used on the web. Django is a web development framework for creating dynamic webpages. A static website is one that only displays information and has no interaction other than simple page requests that is recorded on the server. The purpose of a static website is for the server to provide HTML, CSS, and JavaScript to the client. More features needed to be included in websites which increased the demand for dynamic websites. In which the server keeps data and responds to user input in addition to presenting content. The ... Read More

How to prevent session hijacking in Django?

Gayatri Jandhyala
Updated on 05-Sep-2022 11:01:14

781 Views

Session hijacking or session forging is another security issue that most websites are prone to. In this article, we will know more about the attack and how to protect your website against it. This is a wide class of attacks on a user's session data, rather than a specific assault. It has many forms and they are discussed below. A man-in-the-middle attack occurs when an attacker intercepts session data as it travels over the network. A cookie-forging attack is another type, in which an attacker alters the apparently read-only data saved in a cookie. Websites that have saved cookies ... Read More

How to add authorization to your Django website?

Gayatri Jandhyala
Updated on 05-Sep-2022 10:59:57

689 Views

In order to work with users’ data, first we keep track of data using sessions and later we enable user login by using those sessions. A system that allows developers to authorize an auth/auth system is a term used to describe the system that enables user authentication and authorization. The name (auth/auth) recognizes that dealing with users is often a two-step process. Check a username and password against a database of users to verify (authenticate) that a person is who he or she claims to be. Verify (authorize) that the user is authorized to do a specific operation, usually ... Read More

How to add authentication to Django Website?

Gayatri Jandhyala
Updated on 05-Sep-2022 10:57:40

540 Views

In a web application, there are two key elements to data management. The first is to save data acquired from multiple browser queries, and the second is to use this preserved data to authenticate users. Sessions allow us to keep track of data across numerous browser queries. The second half of the equation is logging in users using those sessions. We cannot trust people to be who they claim they are, so we have to verify their identities along the process. Django, of course, includes tools to perform these and other typical tasks. User accounts, groups, permissions, and cookie-based user ... Read More

How to humanize tags in Django?

Gayatri Jandhyala
Updated on 05-Sep-2022 10:54:52

2K+ Views

Humanize means to make something more humane or human readable. To humanize tags means to makes it easier for the humans to understand. For example, 1800000000 becomes 1.8 billion or 10000 becomes 10, 000. There are simple changes that can be implemented to convert tags to a more human readable format. Django offers template filters that add human touch to data which makes it more appealing to read. To enable the usage of these filters, django.contrib.humanize should be added to the INSTALLED_APPS in the settings.py file of your project. INSTALLED_APPS = [ 'reglogin', 'mlmodel', ... Read More

How to use memcached in Django?

Gayatri Jandhyala
Updated on 05-Sep-2022 10:52:17

2K+ Views

The fact that dynamic websites provide an interactive and adaptable website is their calculations, including database queries, template rendering, and business logic, to produce the page that your site's visitor sees. This is much more expensive in terms of processing overhead than the usual accessing a file from the system server setup. For medium to high traffic sites, it is essential to cut as much overhead as possible. This is where caching comes in. Saving the result of a time-consuming calculation so that you don't have to do it again is referred to as caching. The caching mechanism requires very ... Read More

How to deploy machine learning model using Django?

Gayatri Jandhyala
Updated on 05-Sep-2022 10:50:49

5K+ Views

Django is a high-level Python framework for creating scalable and robust web applications. In Python, this is the most widely used framework. It adheres to the MVT (Model-View-Template) design pattern. Other MVC frameworks, such as Ruby on Rails and Laravel, are closely linked to it. The display and model elements of the MVC framework are managed by the Controller, but in Django, the framework handles the tasks of a controller implicitly. Django allows you to develop several applications within a single project. The application has all the necessary features to function independently. The app is regarded as a package that ... Read More

What is middleware in django

Gayatri Jandhyala
Updated on 02-Sep-2022 14:33:50

4K+ Views

A middleware component is nothing more than a Python class that follows a specific API. In Django, middleware is a small plugin that runs in the background while the request and response are being processed. The application's middleware is utilized to complete a task. Security, session, csrf protection, and authentication are examples of functions. Django comes with a variety of built-in middleware and allows us to develop our own. The Django project's settings.py file, comes equipped with various middleware that is used to offer functionality to the application. Security Middleware, for example, is used to keep the application secure. There ... Read More

What is django ORM?

Gayatri Jandhyala
Updated on 02-Sep-2022 14:30:08

15K+ Views

ORM stands for Object Relational Mapper. The main goal of ORM is to send data between a database and models in an application. It maps a relation between the database and a model. So, ORM maps object attributes to fields of a table. The main advantage of using ORM is that it makes the entire development process fast and error-free. Essentially, it eliminates the need to write SQL code. Suppose there is a python object student with certain attributes as you can see below. Model student: Id Rollno Name ... Read More

How to protect against cross-site scripting (XSS) in Django?

Gayatri Jandhyala
Updated on 02-Sep-2022 14:28:21

437 Views

Web applications that fail to appropriately escape user-submitted text before rendering it into HTML are vulnerable to cross-site scripting (XSS). An attacker can use this to inject arbitrary HTML into your Web page, commonly in the form of a element. XSS attacks are frequently used by attackers to steal cookie and session information, as well as to fool users into providing personal information to the wrong person. Phishing is another term for this. We will look at a common case because this type of attack can take many different shapes and has nearly unlimited variations. Let us consider simple ... Read More

Advertisements