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 […]

[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 […]

How to automate numpy installation in your project using setuptool?

Recently for an opensurce project, I had to work using numpy. Numpy makes life a lot easier, without any doubt, but when it comes to setup.py of setuptool. It does not work just by adding <code>’install_requires:[“numpy”]’ </code> mainly because unlike any other python packages numpy is […]