Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Unit Test Cases with Forms and Views
By writing unit test cases, you can evaluate each code component in the initial stage itself and it'll improve your app/code performance. Which is the best practice to test your code and you can easily determine if there are any errors. -
Querying with Django Q Objects
Querying with Django Q objects: Q object encapsulates a SQL expression in a Python object that can be used in database-related operations. Using Q objects we can make complex queries with less and simple code. -
Django - Migrating from Function Based Views to Class Based Views
The single most significant advantage in Django class-based views is inheritance. On a large project it's likely that we will have lots of similar views. instead of writing the repeated code we can simply have our views inherit from a base view. -
Understanding Checkout Flow in Django Oscar
Explaining Django Oscar checkout flow. -
Integration of Linkedin API in Python Django
Using Linkedin integration, we can get the user's verified email id, general information, and work history in less span of time, and a user can also share articles.These Following steps are needed for Linkedin integration:1. Creating a LinkedIn app2. Authenticating the user and getting an access token3. Get user information, and work history using the access token -
How to Create Initial Django Migrations for Existing DB Schema
Django provides the comfort database migrations from its version 1.8, with which we can avoid the usage of third party packages like south. Adding migrations to new apps is straightforward - they come preconfigured to accept migrations, and so just run make migrations once you’ve made some changes. But if your app already has models and database tables, and doesn’t have migrations yet or you got your migrations messed up, you’ll need to convert your app to use migrations. -
Django Conditional Expressions in Queries
Reduce database queries in django with Conditional Expressions. By using Conditional Expressions we can use "If...Elif...Else" expressions while querying the database so that we can reduce the number of queries to the database and increase the response time. If we don't use conditional expressions in queries we have to write raw SQL queries or we have to hit/query the database for multiple times. That's the reason Django included Conditional Expressions from version 1.8 -
Sorl-Thumbnail to Generate Thumbnails in Django
Displaying and Customizing the images in django with sorl-thumbnail. -
Using Gitlab API, Integrating Gitlab in Django Project for Authentication and Access
This is a simple way to integrate gitlab authentication in your django apps.We can get user verified email id, general information, git lab URL and token from Gitlab API.These Following steps are needed for Gitlab integration:1. creating git lab app2. Authenticating user and getting an access token.3. Get user information, git lab URL using an access token. -
Deploying Your Django App on Heroku
Heroku is a platform as a service (PaaS) that enables developers to build and run applications entirely in the cloud.1. installation2. Creating and Deploying app.3. Dependencies Used -
How to Create Thumbnail Image in Django Templates Using Sorl-Thumbnail?
Sorl thumbnail is the package that is being widely used to generate thumbnails in Django. It will create a thumbnail of a given size for the given image, which won't work out in the case of responsive designs. Html5's 'srcset' attribute is the solution for this problem to load proper images to the corresponding resolutions, whose thumbnails are generated with sorl thumbnail. -
Using Python Weasyprint Generate HTML to PDF in Django
WeasyPrint is to combine multiple pieces of information into an HTML template and then converting it to a PDF document. -
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. -
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 -
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 -
How to Add a Custom Managers in Django
Django Custom Managers - A Manager is the interface through which database query operations are provided to Django models. At least one Manager exists for every model in a Django application. You can use a custom Manager in a particular model by extending the base Manager class and instantiating your custom Manager in your model. There are two reasons you might want to customize a Manager: to add extra Manager methods, and/or to modify the initial QuerySet the Manager returns. -
How to Use Nested Formsets in Django
Django Formsets manage the complexity of multiple copies of a form in a view. By using formsets, you can know how many forms were their initially, which ones have been changed, and which ones should be deleted. In this blog post, we'll explain how nested formsets are used in django -
How to Convert XML Content into Json Using XMLtodict
We need to process large amounts of data to get the desired results from XML file. xmltodict will help you to process, give JSON formatted data within a less span of time. In this blog post, we'll explain to you how to use in a django project. -
Django Webpacker - A Compression Tool to Bundles CSS, Js Files
django-webpacker is a django compressor tool which bundles css, js files to a single css, js file with webpack and updates your html files with respective css, js file path with a single management command. It also supports django-storages to load compressed css, js files from AWS S3. -
Export HTML Web Page to PDF Using JsPDF
jsPDF is used to generate pdf files in client-side Javascript. You can find the links for jsPDF here and also you can find the link to project homepage. You've to include the scripting files/links in head section to work properly.Tip: We have to download the newest version of the library and include it in the HEAD or at the end of the BODY section. -
How to Document API Requests using Django Rest Swagger
Django Rest Swagger is used to Document your API for eg., Listing all Your project Rest API's in the browser with brief description about the API. In Developing an application, we will write our required API's. To Document these API's we use Django Rest Swagger. -
Working with Django Plugins
This blog describes about how to work with django-plugins. Django Plugin is a Simple Plugin Framework for Django. By using django-plugins, you can make your app more reusable. By using it, you can define plugin points and plugins. It comes with many features like synchronization with database, plugins management from django admin and many more. -
How to Create Custom User Model or Extend User Model in Django
Django provides built in authentication which is good for most of the cases, but you may have needs that are being served with the existing system. For Ex: You want 'email' for authentication purpose rather than Django's username field and you want an extra field called 'display_name' as full name for the logged in User. To meet the above requirements, we need to customize Django's built-in user model or substitute a completely customized model. -
Django Single Sign On(SSO) to Multiple Applications
Single sign on is a way for users to issue a security token for the first time login, login into multiple applications using one set of credentials i.e security token.Adding sso to an application will make things easier for users because they don't need to remember login credentials for multiple applications. User just needs to enter their login credentials for the first time instead of re-entering their credentials for every application login. -
Understanding Routers in Django-Rest-Framework
By using routers in django-rest-framework we can avoid writing of url patterns for different views. Routers will save a lot of time for developing the API for larger projects. Routers generates standardized url patterns for better maintenance of url structure. We can expect consistent behaviour from viewsets and routers. We can also avoid repetitive code in views.