2020欧洲杯手机版注册

A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [django-rest-framework]

A powerful and flexible toolkit for building RESTful Web APIs. Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

How to update a default value of boolean for notification on and off in django rest framework

class NotificationOnOffSerializer(serializers.ModelSerializer): """ To create class for get account function """ is_allow_notify = serializers.BooleanField(required=True) class ...
-2
votes
0answers
10 views

Django Rest Framework simplejwt

how to use rest_framework_simplejwt with email for token?I tryedclass EmailTokenObtainSerializer(TokenObtainSerializer): username_field = User.EMAIL_FIELD
0
votes
0answers
9 views

How to send push notification on IOs using fcm_django

I'm using this plugin to send push notifications from my Django REST app.http://github.com/xtrinch/fcm-djangoIt works fine for the android side but IOs are unable to receive any notifications. ...
0
votes
1answer
26 views

DRF need values instead of ID

This is my serializer classclass ProjectSerializer(ModelSerializer): class Meta: model = Project exclude = ['deleted_at']This is Models.pyclass MandatoryFields(...
0
votes
2answers
28 views

How can I use filter option in django rest framework using function based view

Here is my model: class Customer(models.Model): name = models.CharField(max_length=250) age = models.IntegerField() status = models.IntegerField()And the serializer is :...
-1
votes
0answers
17 views

social sign up with django-rest-auth and the custom user model (resources)

I am working on user authentication on my app using django-rest-auth. I also want to be able to connect to my custom model when the user is signing up with Google and Facebook signup to populate the ...
0
votes
0answers
24 views

db query optimisation with alternate ways to handle expandable_fields

I am using ExpanderSerializerMixin as follows:class StateSerializer(ExpanderSerializerMixin): class Meta: model = State fields = ['name', 'population']class CountrySerializer(...
0
votes
0answers
14 views

djnago rest api data is not loading in Angular localhost page(client)

I have created REST API in django. For frontend i am using Angular framework. In django my site for showing all the data is 'http://127.0.0.1:8000/flightschedule/'.Now for angular in routing module ...
-1
votes
1answer
38 views

How do I fetch a list of model objects by querying another related model in a many to many relationship in DRF

models.py:class OrderItem(models.Model): image_number = models.CharField(max_length=20) title = models.CharField(max_length=20) image_url = models.URLField(max_length=200,null=True,...
1
vote
1answer
33 views

Django can't login with valid credentials

Django doesn't login my user. I'm using a Django REST call to do this:class UserLogin(APIView):permission_classes = []def post(self, request, *args, **kwargs): if request.method == 'POST': ...
1
vote
2answers
38 views

Pagination not working for viewsets in django rest_framework

paginate.pyclass StandardResultsSetPagination(PageNumberPagination): page_size = 3 page_size_query_param = 'page_size' max_page_size = 5Serializers.pyclass AreaUsersSerializer(...
0
votes
1answer
15 views

Django Rest Framework GeoDjango Serializers

Is there a way to create a serializer using the User model that shows the locations stored under that user?I can create regular location serializers, however, I want to be able to create a url like ...
2
votes
1answer
23 views

Why I get error when run two tests in Django APITestCase?

I make tests for my API. When I run two tests I get error apps.users.models.DoesNotExist: User matching query does not exist. in line self.user = User.objects.get(pk=48) on the second test. But if I ...
0
votes
0answers
17 views

Django JSON structure for a javascript app

I am creating a course exam, but however the front end. I need to add some buttons created by javascript, but before creating the buttons needs to be done via API which needs key, value to be created ...
0
votes
1answer
27 views

Can not run tests in APITestCase

Structure of projectproj/ apps/ app1/ ... tests.py ... proj/tests.pyclass UsersTestCase(APITestCase): def setUp(self): self.user = User.objects.get(id=3) ...

15 30 50 per page