Skip to main content

All Questions

Tagged with
0 votes
1 answer
42 views

Filtering With DRF

I'm currently trying to add filter to a menu API but it doesn't seem to work This is what I tried in my views.py: @api_view() def menu_items(request): if request.method == "GET": ...
Lorenzo's user avatar
0 votes
1 answer
43 views

post name, email and role in django backend, react frontend error 400

i want to the admin to post name, email and role of a user using frontend, and its stored in backend of django, please note that i dont want the admin to store the password, the user will later on add ...
Maryam Naveed's user avatar
0 votes
0 answers
30 views

Adding request.user to model field in django rest framework upon form submission

I am working on an app using Django and React and I use DRF to create APIs. I have a form that contains a field called submittedUser that I want it to define the user that posted the form in models.py ...
Mostafa Mohamed's user avatar
1 vote
1 answer
179 views

How to use import Geopackage data to my Django RESTful API?

I want to create a full-stack web application to let users query parks and greenspace in the UK, something like this: https://www.barnet.gov.uk/directories/parks. I want to build a Django RESTful API ...
jethro-dev's user avatar
0 votes
1 answer
89 views

Flutter Exception "type 'String' is not a subtype of type 'int' of 'index'" when fetching filtered api data

I'm making an Android app with local Django Restful Api. I have 2 models in database, that are nested together, ShowsModel and DirectorModel. This is basically how my JSON looks like with GET function....
amyhawks's user avatar
0 votes
1 answer
132 views

How can I send both file and json data in a single request in Django using Requests library on the client side?

I need to send json data and file to my api in django. In the client side i use requests and i will share that code below. I tried this code but it gave "django.http.request.RawPostDataException: ...
ivenoidea's user avatar
0 votes
0 answers
635 views

Getting 'Invalid request method' error when trying to pass Scrapy data to Django using Python APIs

I have a problem, I created a scrapy project and a django project with an application, I registered the application, set the urls, set the views, and also wrote the spider, but when I go to the ...
Roman's user avatar
  • 5
0 votes
2 answers
126 views

How to display images in Flutter app from Django Rest API?

I have problems with displaying images, that are saved in my database in Django Rest API. This is my postman output for the API: [ { "id": 1, "name": "...
amyhawks's user avatar
1 vote
1 answer
578 views

Deployment error. Error running WSGI application. ModuleNotFoundError: No module named 'api.urls'

I deployed my django project to pythonanywhere, but when I enter the page, this error is displayed in the logs: Error running WSGI application ModuleNotFoundError: No module named 'api.urls' Structure:...
DNA's user avatar
  • 15
0 votes
1 answer
102 views

having problem to use annotate in django to return nested list

I have a model in django named Courses and it has a ManyToManyField which is related to the teachers Model. now in the views file I'm gonna make an APIView to return a list of courses which each ...
Mohammad Mohammad Hosseiny's user avatar
0 votes
1 answer
608 views

How to make multiple APIs in parallel using Python Django?

Currently, I have 2 API enpoints. The first API enpoint takes in a file as input and performs some calculations that take up to 30 minutes. The second API endpoint is a healthcheck that returns the ...
ENV's user avatar
  • 1,188
0 votes
1 answer
168 views

I have trouble connecting my Django REST api to Flutter mobile app

I'm making an Android application, that has Django REST api. Didn't have any trouble setting up the api, but I can't connect it to my application. I'm really new to it, so... I tried running my app ...
amyhawks's user avatar
0 votes
1 answer
96 views

Why we use super().perform_update(serialixer) when we redefining methods?

Why we use super().perform_update(serializer)? But not serializer.save() ? What's the difference? def perform_update(self, serializer): if serializer.instance.author != self.request.user: ...
Alexander's user avatar
0 votes
1 answer
612 views

Is it possible to find a JWT token is expired in Django rest framework

Is it possible to find whether a JWT token is expired or not when both authentication_classes and permission_classes classes are present? Suggestions showing that try with simplejwt exception class. ...
jps's user avatar
  • 1
2 votes
1 answer
53 views

Function to update last sensor value in Django

I have created an API for several environmental sensors using models. I am trying to create a function to receive the latest value from the Django database and retrieve it. This is my models.py file ...
Gerasimos Papanikolaou's user avatar

15 30 50 per page
1
2 3 4 5
124