When you are lucky enough to have enough users that you decide to roll another cloud instance for your django app, logging becomes a little bit tough because in your architecture now you would be needing a load balancer which will be proxying request from […]
Tag: django
Dealing with mandatory ForiegnkeyField for fields that is not in django rest framework serializers
Although I am big fan of django rest framework but sometime i feel it is gruesome to deal with nested serializers (Maybe I am doing something wrong, feel free to suggest me your favourite trick.) Suppose we have two models, ASerializer is based on A […]
A Django Rest Framework Jwt middleware to support request.user
I am using following Django (2.0.1), djangorestframework (3.7.7), djangorestframework-jwt (1.11.0) on top of python 3.6.3. By default djangorestframework-jwt does not include users in django’s usual requst.user. If you are using code>djangorestframework, chances are you have a huge code base at API which is leveraging this, […]
Integrating amazon s3 with django using django-storage and boto3
If we are lucky enough to get high amount of traffic at our website, next thing we start to think about is performance. The throughput of a website loading depends on the speed we are being able to deliver the contents of the website, to […]
[Code snippet] Django rest framework social oauth2 user sign up and sign in
At my serializers.py I have got the following: from django.contrib.auth.models import User from rest_framework import serializers class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = (‘username’, ’email’, ‘password’) def create(self, validated_data): return User.objects.create_user(**validated_data) at my views.py I have […]
Customize django admin page from the scratch
In my last project with django, I had to modify and extend django admin page massively, there were cases when I had to wipe out curren admin page and create on my own. Usually people don’t go through this kind of trouble I guess, they just […]
One workaroud to pass variables (context) to django admin submit_line.html template
Recently I had to modify django admin page massively, while trying to add a new button at add new model item at admin page I got into trouble, trouble was not to show the button, or get that button working but it was at variable […]