Most voted "django-rest-framework" questions
57 questions
Sort by count of
-
-1
votes1
answer603
viewsNameerror: name X' is not defined - Django Rest framework
Following the tutorial for creating API with DRF, I encountered difficulties while mapping the urls. By running 'python manage.py runserver', I get the following error path('', include(loja.urls)),…
-
-1
votes2
answers100
viewsSearch between two dates in Django
I have a program where I need to search through GET on Django the data present between two dates (the user will define these dates) Models py. class Data(models.Model): dev =…
-
-1
votes1
answer34
viewsInterrupt the POST Django
I am developing a customer registration project/ addresses/ products, and now I am doing the inventory part (list which products certain clients hired), and I put to send the customer ID and…
-
-1
votes1
answer26
viewsHow do I make a Boolean field model to accept only 1 true and multiple false values in Django?
An example of a client’s model address: class Address(models.Model): activate = models.BooleanField(null=False, default=False) AddressLine1 = models.CharField(max_length=60, blank=True, null=True)…
-
-1
votes1
answer26
viewsCreate serialization with data from two tables
Good evening guys, I need help to be able to serialize the data according to "Desired result" but I’m only getting the result of the image "Result I’m getting", someone can help me? Thank you!…
-
-1
votes0
answers18
viewsDRF to delete multiple records with field other than ID
I am using the Django Rest Framework and would like to make a mass exclusion using the "contract" field which is an interger. View py. class AlugueisViewSet(viewsets.ModelViewSet): filter_backends =…
-
-2
votes1
answer23
viewsshow value instead of foreign key DJANGO API
Model from django.db import models from django.contrib.auth.models import User user_agent = models.ForeignKey(User, on_delete=models.CASCADE) def __str__(self): return self.name VIEWS from…