Explore a blog dedicated to a wide spectrum of topics including Django, Python, Machine Learning, Salesforce, Angular, React, Flutter, Svelte, LINUX, and Amazon Web Services.
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.
Preserve File Names with Sorl for Better SEO
We use sorl-thumbnail for scaling images by keeping the original one intact. Sorl proven to be great tool for generating different sized images throughout website. I presume that you know how to use sorl-thumbnail. Here we see how to preserve filename. Search Engines will give importance to image alt tag content but it definately have some impact on relevant image file name too.
How to Pass Extra Context Data to Serializers in Django-Rest-Framework
Django rest-framework passes extra context data to serializers for the best design of rest applications. we can use "context" parameter in serializers to pass extra context. In viewsets, generic view simply override or overload the method get_serializer_context.
Custom Password Less Authentication in Django
Authentication backends allow the ability to change what method checks your users credentials.
For web services, ie Facebook authentication, you don't have access to user data like a password. Without password(not like random string) we can't create a user in django. Facebook connect provides you details of the currently authenticated user.
Overriding Django Model Behaviour with Proxy Model
The main Usage of a proxy model is to override the main functionality of existing Model. It is a type of model inheritance without creating a new table in Database. It always queries on original model with overridden methods or managers.
How to Filter a Django Queryset using Extra
Using SQL Queries in Django ORM - Filtering extra objects within in a single query, to reduce the number of queries.
Django Acceptance Testing Automation with Robot Framework
Acceptance testing automation for django web and REST applications using a robot testing framework.