django-rest-framework Questions
2
The problem we are facing is the following: When using Safari as a browser, rather than Chrome, we receive a 401 status on a get api call. The technologies we are using are React and Django Rest Fr...
Wanton asked 24/5, 2018 at 18:1
3
Solved
I have three different types of objects: RawArticle, RawPatent and RawGrant.
I have great working serializers, whose base class is serializers.ModelSerializer.
If I retrieve a query set of RawArt...
Madai asked 20/1, 2014 at 13:27
8
Solved
I'm using Django REST framework with djangorestframework-csv with default pagination settings, but when request is with format "CSV", there is no need in paginaion. Is possible to disable paginatio...
Basipetal asked 5/6, 2017 at 13:36
5
When i do the following command over Terminal using curl
curl -X POST http://myuser:[email protected]:8000/call/make-call/ -d "tutor=1&billed=1"
I get the following error
AssertionEr...
Amygdaline asked 27/4, 2014 at 6:16
5
Solved
I'm have a Django model that serves as a request description. It is created to issue a request by a REST client, serves to record the tasks current status, and record historical requests received b...
Germainegerman asked 21/10, 2016 at 22:26
6
Solved
I have a token string from Django REST Framework's TokenAuthentication.
I need to get the corresponding user object. How would I go about doing this?
Dyeing asked 27/5, 2017 at 1:54
24
Solved
I am using Django Rest Framework and AngularJs to upload a file. My view file looks like this:
class ProductList(APIView):
authentication_classes = (authentication.TokenAuthentication,)
def get(...
Wilmott asked 9/12, 2013 at 14:53
2
Solved
I am serving an image using the Django REST framework. Unfortunately it downloads instead of displays. I guess I have to set the header Content-Disposition = 'inline'. How do I do this in the View ...
Chanachance asked 21/12, 2018 at 16:6
5
Solved
I am generating aggregates for each item in a QuerySet:
def get_queryset(self):
from django.db.models import Count
queryset = Book.objects.annotate(Count('authors'))
return queryset
But I am ...
Indirection asked 25/8, 2013 at 22:35
4
Solved
I have a simple question: Currently I can do this to get an object from my backend:
http://127.0.0.1:8000/api/v1/boats/boats?id=10
http://127.0.0.1:8000/api/v1/boats/boats?home_port=98&id=5
...
Royal asked 5/7, 2015 at 5:27
5
I have a very simple APIView, but I don't know how to setup pagination here.
In this scenario I select an Event with given pk, then I get all the NewsItems assigned to this Event.
pagination_clas...
Jejune asked 6/3, 2016 at 18:29
7
Solved
I'm using a django-oneall to allow social login session authentication on my site. While it isn't one of the suggested auth providers for django-rest-framework, rest_framework.authentication.Sessio...
Goldwin asked 18/9, 2015 at 13:39
10
Solved
I'm working on a store site, where every user is going to be anonymous (well, until it's time to pay at least), and I'm trying to use Django REST Framework to serve the product API, but it keeps co...
Seow asked 23/11, 2014 at 3:15
3
Solved
In my Django project, I have a view that when a user posts a zip file, it will respond immediately back and then process the data in the background with the help of threading. The view works fine i...
Bole asked 12/9, 2019 at 9:45
13
Solved
How can I enable CORS on my Django REST Framework?
the reference doesn't help much, it says that I can do by a middleware, but how can I do that?
Ninette asked 3/3, 2016 at 0:32
10
Solved
I am having problem with django rest framework pagination.
I have set pagination in settings like -
'DEFAULT_PAGINATION_CLASS':'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 1
Be...
Greenheart asked 16/2, 2016 at 12:44
3
Solved
I have previous experience in Django. If add line {csrf_token} in Django templates then Django handles the functionalities of csrf_token. But when I am trying to develop an API using Django REST Fr...
Issacissachar asked 7/6, 2018 at 4:9
7
Solved
I created a restful api with django-rest-framework accessible with this URL http://192.168.33.10:8002/scenarios/ and I'm creating a React app to make calls to the api an d consume its data.
I'm u...
Brabazon asked 18/5, 2017 at 2:13
4
Solved
Ubuntu LTS, Python 3.6.x, Django 2.2.1, DRF 3.9.3
I started with the DRF quickstart. Worked fine.
Jumped into the DRF tutorial, step 3 on using generic class based views I'm getting this error wh...
Characterization asked 9/5, 2019 at 5:44
8
Solved
In django rest framework, I am able to upload single file using danialfarid/ng-file-upload
views.py:
class PhotoViewSet(viewsets.ModelViewSet):
serializer_class = PhotoSerializer
parser_classes =...
Pluvious asked 22/9, 2016 at 17:32
4
Solved
I'm using a custom authentication scheme and I cannot figure out how to get it to send 401 HTTP responses instead of 403. The guide at http://www.django-rest-framework.org/api-guide/authentication/...
Kasandrakasevich asked 29/2, 2016 at 15:18
4
I am using Django Rest to create a simple API.I need to create a view where the user can change his/hers password.I am using the default Django user model and a simple UserSerializer. There is meth...
Arguable asked 24/4, 2014 at 17:32
12
Solved
I'm building a RESTful API with Django and django-rest-framework.
As authentication mechanism we have chosen "Token Authentication" and I have already implemented it following Django-REST-Framewor...
Rarebit asked 28/1, 2013 at 17:21
1
I am using Djoser to create an authentication backend. I want the following to happen:
User registers at http://localhost:8000/auth/users/ with email, username, password, and re_password
User rece...
Noiseless asked 15/7, 2021 at 22:13
4
Solved
Django-filter with DRF - How to do 'and' when applying multiple values with the same lookup?
This is a slightly simplified example of the filterset I'm using, which I'm using with the DjangoFilterBackend for Django Rest Framework. I'd like to be able to send a request to /api/bookmarks/?ti...
Oldfangled asked 17/12, 2016 at 0:22
© 2022 - 2024 — McMap. All rights reserved.