Handling Multiple Forms on the Same Page in Django

By: renjithsraj ● Feb. 20, 2018, 2:21 p.m. ● Tags: Uncategories

In this article we are going lookup , how to create multiple forms in same template in django projectThe premise Let's say there are two forms on the page. One form for the user to subscribe to, which only accepts email, and the other a contact form that takes in ...

Read More →

Django Migrations and How to Manage Conflicts - Part 1

By: renjithsraj ● Feb. 18, 2018, 9:50 p.m. ● Tags: #Django, #Databases

In this Article we going to cover about django model migrations , Migrations are one of Django’s most useful features, but for me, personally, , I was still scared of migration conflicts or losing the data or having to manually modify the migration files or this or that. The thing ...

Read More →

Django Models Methods that return new QuerySets

By: renjithsraj ● Feb. 17, 2018, 1:57 p.m. ● Tags: Uncategories

This article describes the details of the QuerySet API. It builds on the material presented in the model and database query from official django guides, so you can read this for get more details. In this post we are gonna look up the common methods that's users for return new ...

Read More →

File Handling in Amazon S3 with Python Boto Library

By: renjithsraj ● Feb. 13, 2018, 11:02 p.m. ● Tags: #Django, #Python3, #Python2, #Hosting Service

1. IntroductionAmazon Web Services (AWS) Simple Storage Service (S3) is a storage as a service provided by Amazon. It a general purpose object store, the objects are grouped under a name space called as “buckets”. The buckets are unique across entire AWS S3.Boto library is the official Python SDK for ...

Read More →

How to write custom validations for django rest framework serializer.

By: renjithsraj ● Feb. 10, 2018, 4:03 p.m. ● Tags: #Django, #RestAPI

Django Rest Framework integrates well with models to provide out of the box validation, and ModelSerializers allow futher fine-grained custom validation. However, if you’re not using a model as the resource of your endpoint then the code required for custom validation of complex data structure can get hairy. In this ...

Read More →

Django REST Framework: JSON Web Tokens (JWT)

By: renjithsraj ● Feb. 8, 2018, 11:34 p.m. ● Tags: #Django

We have already covered with Authentication, Permissions and JWT (Json web Token). In that post, we learned how to use the built in Token based authentication in DRF. In this post, we will learn more about JSON Web Tokens aka JWT and we will see if JWT can be a ...

Read More →

What is JWT (JSON Web Tokens) ?

By: renjithsraj ● Feb. 7, 2018, 11:53 p.m. ● Tags: #Django, #RestAPI

What is JWT?We will ignore the text book definitions and try to explain the concepts in our own words. Don’t be afraid of the serious looking acronym, the concepts are rather simple to understand and comprehend. First let’s break down the term – “JSON Web Tokens”, so it has to ...

Read More →

How to Extend The Django 2.0 Custom User Model

By: renjithsraj ● Feb. 4, 2018, 9:43 p.m. ● Tags: #Django, #Python3

The official Django documentation highly recommends using a custom user model for new projects, but it doesn’t provide a complete implementation of what one looks like. After spending way too much time figuring this out on my own, here is the short, concise way to configure a custom user model ...

Read More →

Django REST Framework: Serializers

By: renjithsraj ● Feb. 4, 2018, 1:52 p.m. ● Tags: #Django, #RestAPI

What can a Serializer do for us?Have you ever tried JSON serializing a Django model? Or a queryset? You can’t directly because they are not JSON serializable. So what do we do instead? We convert them to Python’s native data structures which could be serialized into JSON. We can serialize ...

Read More →

Django Rest framework Authentication and Permissions - Part 3

By: renjithsraj ● Feb. 3, 2018, 3:50 a.m. ● Tags: #Django, #RestAPI

In this blog post, we would see how we can secure our endpoints with user authentication and permissions. Authentication will help us identify which user is currently logged in and permissions will decide which user(s) can access which resources. AuthenticationThe idea of authentication is pretty simple. When a new incoming ...

Read More →