How to Maintain User Session Across Sub Domains in Django
Nowadays, people are using wildcard domains to provide same user experience across different domains. Using subdomains, we can be able to host multiple sites with the same domain name with the same code in a less time. To enable wildcard subdomains for your site, you should add CNAME record like.
Custom Validations for Serializer Fields Django Rest Framework
we can write custom validations for serializer fields in Django Rest Framework. Validators are used to validate the data whether it is semantically valid or not. Validation simplifies the data processing. Validation avoids the data redundancy
Introduction to API Development Using Django REST Framework with Example
Introduction to API development with Django REST framework. You can build the API for any Django application. Pre-requisites are Django and OOPS(object oriented programming concepts) . In this
Django-REST Framework Object Level Permissions and User Level Permissions
Django-REST User Level Permissions and Object Level Permissions. User Level Permissions and Object level Permissions allow to serve customers based on their access levels or permissions. Let us consider the scenario of Authors, Books, Readers. Authors are only allowed to write the books. Readers are only allowed to read the allowed Books.
Sorl-Thumbnail to Generate Thumbnails in Django
Displaying and Customizing the images in django with sorl-thumbnail.
Improving Page Speed Score in Google Page Score Test- PART2
In our previous blog post we got an idea of what are the things that Google's Page Speed Insights will take into count to give page score, now in the present blog post we'll get to know what are the techniques we can use to improve the page score.
Extract Text with OCR for All Image Types in Python Using Pytesseract
Optical Character Recognition(OCR) is the process of electronically extracting text from images or any documents like PDF and reusing it in a variety of ways such as full text searches. In this blog, we will see, how to use 'Python-tesseract', an OCR tool for python. It will recognize and read the text present in images. It can read all image types - png, jpeg, gif, tiff, bmp etc. It’s widely used to process everything from scanned documents.
Factory Boy - An Alternative for Fixtures
Factory Boy is a fixtures replacement tool. It allows you to use objects customized for the current test, while only declaring the test-specific fields. For testing the Django app, create a root directory named tests. Then create __init__.py, tests.py (to write your tests), factories.py (to write your model factories) in that directory.
Improving Page Speed Score in Google Page Score test- PART1
Google's Page Speed Insights measures the performance of a page for mobile devices and desktop devices. It fetches the url twice, once with a mobile user-agent, and once with a desktop-user agent.
The Page Speed Score ranges from 0 to 100 points. A higher score is better and a score of 85 or above indicates that the page is performing well.
Get Count, Average, Min, Max Values from Model Field using Django Aggregate
To retrieve maximum, minimum or average values from group of rows we can use django Aggregation. For example to retrieve max price or avg price of product from catalogue.