Thanks for looking into this.
Attaching the files(models.py, views.py and urls.py from app) for
reference, please look into this and give some feedback
Thanks,
Prabu
On Fri, May 17, 2019 at 9:16 PM Andréas Kühne <andreas.ku...@hypercode.se>
wrote:
> Hi,
>
> You need to provide more information for us to be able to help you. Can
> you provide some more background information about:
> 1. What you are trying to do - and what you have previously done?
> 2. models.py, views.py or any other files you think can be relevant (or
> code snippets from them)..
>
> Just showing the error code is unfortunately not that easy for us
> to understand because of djangos versitality - it can be used in so many
> different ways!
>
> Regards,
>
> Andréas
>
>
> Den tors 16 maj 2019 kl 17:32 skrev Prabakaran Balaji <
> prabu.b...@gmail.com>:
>
>> Hi,
>>
>> Error - "detail": "Method \"PUT\" not allowed."
>>
>> Getting above error When I try to update the model. Can someone help me
>> on this?
>>
>>
>> Thanks,
>> Prabu
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAK7fxT99v3BjpG3svU3sWh2_bvnEzLiGnhp-z3WiLTHV98Y4uA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAK7fxT99v3BjpG3svU3sWh2_bvnEzLiGnhp-z3WiLTHV98Y4uA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK4qSCeHRSmBOXV%3Dnfa5WyUpM5NQz76DRyO4hm1rnWriQn2wOA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK4qSCeHRSmBOXV%3Dnfa5WyUpM5NQz76DRyO4hm1rnWriQn2wOA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAK7fxT8aiHdU22Ez5npQJbaHfaBKK8wm0EZ_%3Dkp2tJKYzC7ynA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
from django.db import models
class Agent(models.Model):
name = models.CharField(max_length=100)
address = models.TextField()
age = models.CharField(max_length=10)
rating = models.CharField(max_length=100)
code = models.CharField(max_length=50,primary_key=True)
bank_details = models.TextField()
from django.conf.urls import include, url
from policy import views
from rest_framework.urlpatterns import format_suffix_patterns
# Class based view url update
urlpatterns = [
url('agent/', views.AgentList.as_view()),
url('agent/<int:pk>', views.AgentDetail.as_view()),
]
from policy.models import Agent, Customer
from policy.serializers import AgentSerializer
class AgentList(generics.ListCreateAPIView):
queryset = Agent.objects.all()
serializer_class = AgentSerializer
class AgentDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Agent.objects.all()
serializer_class = AgentSerializer