I am trying to serialize model instance as i can't reach out the url or the details of the 'followiing' model.
from django.core import serializers
from django.contrib.auth import authenticate
from django.contrib.auth.models import update_last_login
from rest_framework_jwt.settings import api_settings
from django.core import serializers
from rest_framework import serializers
from urllib import request
from rest_framework.permissions import AllowAny,IsAuthenticated
from rest_framework import routers, serializers, viewsets
from django.http import HttpResponse
class UserSerializer(serializers.HyperlinkedModelSerializer):
jsonfollowing = serializers.serialize('json', [ followiing ,])
class Meta:
model = User
fields = ('id','email','username','password','followiing','jsonfollowing')
But i get the following error
AttributeError: module 'rest_framework.serializers' has no attribute 'serialize'
Does anybody know why?