CARVIEW |
Select Language
HTTP/2 200
date: Wed, 30 Jul 2025 10:54:00 GMT
content-type: text/html; charset=utf-8
cf-ray: 967450c13ec2b22e-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=8e129661-39c9-4c26-a845-2138ce7d27b6; expires=Thu, 30 Jul 2026 10:54:00 GMT; domain=.stackoverflow.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
feature-policy: microphone 'none'; speaker 'none'
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: 94535124-9475-43a6-9e19-aceab0a5ba3a
x-worker-origin-response-time: 497000000
x-dns-prefetch-control: off
set-cookie: __cflb=02DiuFA7zZL3enAQJD3AX8ZzvyzLcaG7vZHzFhjqB36yr; SameSite=Lax; path=/; expires=Thu, 31-Jul-25 09:54:00 GMT; HttpOnly
set-cookie: prov=8e129661-39c9-4c26-a845-2138ce7d27b6; Path=/; HttpOnly; Domain=stackoverflow.com
set-cookie: __cf_bm=ue_Yg7KIIBXxn.ehsQJjpfKJWgjoj_QszL_bYPoAUMs-1753872840-1.0.1.1-DEEkUQEB2t5Y3Vrnywmk9BTVPahMUgV0LO1J0jSXMvaxPOzGbG9DUiZGCfJNfkdM6USrASzWUwJiRWyCR.oWBsxUxYE6M5OsPrrzBuKr8ak; path=/; expires=Wed, 30-Jul-25 11:24:00 GMT; domain=.stackoverflow.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=AKanEchWLNnvC_5MsY7VilDb7X.OBhP7GwI8WM1vH3Q-1753872840390-0.0.1.1-604800000; path=/; domain=.stackoverflow.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'django-rest-framework' Questions - Stack Overflow
Skip to main content
Stack Overflow
- Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
- Advertising Reach devs & technologists worldwide about your product, service or employer brand
- Knowledge Solutions Data licensing offering for businesses to build and improve AI tools and models
- Labs The future of collective knowledge sharing
- About the company Visit the blog
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more.
View results.
Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
31,750 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
55
views
Django Rest viewsets.ModelViewSet form view dynamic update choices list field from other field change
file models.py
ANIMATIONS_ACTIONS = (
('0', _('Stop animations')),
('1', _('Start animations')),
('2', _('Restart animations')),
('3', _('Suspend animations')),
('4', _('Unload ...
0
votes
1
answer
40
views
Django REST Framework `pagination_class` on ViewSet is ignored
Describe the Problem
I have a ModelViewSet in Django REST Framework designed to return a list of Order objects. To improve performance, I'm trying to implement custom pagination that limits the ...
0
votes
2
answers
58
views
how DRF undestand which field in serialazer.py is related to which model field?
imagine i have a super simple serializer.py file :
and i just want to use it ! nothing special ..
so im going to write something like this (with a model class called "Product") & its ...
2
votes
1
answer
35
views
source is not working for deserializing POST data in django rest framework
The following example doesn't work as expected, and returns a validation error. Why is that?
from rest_framework import serializers
class TestSerializer(serializers.Serializer):
from_field = ...
1
vote
1
answer
32
views
need to combine an enum and a timesstamp in DRF
Django Admin: How to combine archived_at and archive_status into one archival source?
I’m building a feature to archive users via Django Admin. Currently, I’m using both a DateTimeField (archived_at) ...
1
vote
1
answer
30
views
DRF I need object/instance-level premissions granted but view/model-level permissions denied
I have a rather simple backend and API with two user types, User and Admin. I have created groups and permissions in Django. The Admin should CRUD everything and the User should only view and edit ...
1
vote
2
answers
107
views
How to use CustomUser with dj_rest_auth to sign up with email and password
How to use CustomUser with dj_rest_auth to register with email and password.
I have the source code below, but the username information is required during the sign-up process.
I would like to know how ...
1
vote
1
answer
44
views
Slug is not created correctly due to using django parler
I have a problem creating a slug based on the title and pk, due to the use of parler.
I'm using Parler for multilinguality in my API, and when I try to create a slug like
title-pk I'm getting various ...
1
vote
1
answer
53
views
How to support multiple Google Cloud Storage buckets in a Django FileField without breaking .url resolution?
I'm using Django with django-storages and GoogleCloudStorage backend.
My model has a FileField like this:
raw_file_gcp = models.FileField(storage=GoogleCloudStorage(bucket_name='videos-raw'))
At ...
0
votes
1
answer
40
views
How do I log filtered GET requests on a Django REST Framework ModelViewSet using @action?
I have a ModelViewSet for EventReportLink and need to log every time someone queries with ?event_report__id=<id>. I’ve tried adding a custom @action(detail=False, methods=['get']), but I’m not ...
0
votes
1
answer
30
views
How to make DRF use url path as empty and base path?
I am trying to omit the URL path for an action in a ViewSet like
@action(detail=False, methods=['patch'], url_path='')
def update_current_user(self, request):
But when I give url_path as an empty ...
1
vote
1
answer
51
views
Elasticsearch search only by one field
I have app on drf and i added elasticsearch(django_elasticsearch_dsl) for searching. But i faced with problem, when i want to search on two or more fields, elastic searching only by one field.
I'm ...
1
vote
1
answer
79
views
React doesn’t receive API tokens after Google OAuth redirect via social_django/drf-social-oauth2
I'm implementing Google OAuth2 for my Django REST API with a React frontend. The basic flow is set up correctly.
I have routes for:
urlpatterns = [
path("admin/", admin.site.urls),
...
0
votes
1
answer
53
views
CSRF token not set
I was creating my api using django restframework. I am using simple jwt for authentication. The tokens are generated after user login via his/her email and password but before login email must be ...
3
votes
3
answers
34
views
DRF Delete API Method Get Error instead of delete
I'm trying to delete a Classroom object from the database. When I try to go to Django Rest Web Browser to fetch api/classroom/delete/1/ I get this response.
HTTP 405 Method Not Allowed
Allow: DELETE, ...
- The Overflow Blog
-
-
- Featured on Meta
-
-
-
-
-
-
Hot Network Questions
- Has the similarity between diagrams of the expanding universe and of vapour pressure in mixtures been noted by others? Is this just coincidence?
- Short story about a scientific rivalry that leads to madness
- Trouble Texturing Extruded Contour Map
- Is a normality test always performed on errors and not on raw data?
- I struggle to draft without editing
- Why is Donald Trump portrayed like a Canadian in South Park S27E01?
- Seven-dimensional cross product
- When using Da Capo, does that normally include a pick up?
- LTSpice op-amp non-inverting input acts like pull-up
- What were WW2 electronics wires made of?
- How can my dwarves keep humans from reverse engineering their technology?
- An SF novel where a very young child escapes being murdered by hiding in the water tank of a toilet
- Should I regularly reapply thermal paste?
- VMWare, SAN, SSD, Influence of the fill level on the performance of a virtual hard disk
- Is the final part of an RNAV approach essentially a visual approach?
- What are these orange and green solid circles painted on a taxiway?
- Are all Universities this internally cut-throat?
- Hybrid centrifuge module for an interstellar spacecraft
- Why do C compilers still prefer push over mov for saving registers, even when mov appears faster in llvm-mca?
- How do I verify a syndrome extraction circuit for a given stabilizer code?
- Was Caiaphas a Prophet or a Villain? (John 11:51)
- Finite projective plane with trivial automorphism group
- Is it ethical to hire a graphic designer for a job talk?
- "One can" in technical writing--good, bad, indifferent?