Category "django-rest-framework"

Need to override save method for image field and save it as base64 string using django

models.py class Organisation(models.Model): org_id = models.CharField(max_length=50,default=uuid.uuid4, editable=False, unique=True, primary_key=True)

xml attributes instead child elements

Using djangorestframework-xml, can someone please help me how to render child elements as attributes? Following the example below <CreateCustomerAndMortgage&

The new url id is getting appended after the previous request's url

I'm making a get request in django using html form as: crud.html <form action="{% url 'crudId' id %}" method="get"> <div class="col">

How can I get 'sign in with Google' to work using 'dj_rest_auth'?

I'm trying to implement Google sign in using DRF and dj_rest_auth. I've set up 'django-allauth' with Google as provider and the sign in process works in the web

Django rest framework: Unit testing post request gets status code 400

I'm doing some unit tests in this restaurant app, and the API request to cancel orders returns code 400 when running "manage.py test" command, but doing the sam

OpenID Connect + Django DRF + React: How to use?

I have a web application made up of two parts: back-end which is implemented using Django + Django Rest Framework (DRF), and front-end which is a React App proj

In django admin panel permissions given to the users by group not working

In Django admin panel I create groups and give permission to them. eg: Create a Student Group and give it permission to view the student model. Create a Teacher

How to filter in django by greater than or less than dates?

I'm a little confused with the documentation on Django Rest Framework. I have read it several times but I cannot makes sense of it. Maybe I'm not smart enough,

Django bulk update list of objects

I want to create an API endpoint, where you can PUT list of objects and it will work like this: If the ID is specified, query that object and try to update it (

AttributeError: type object has no attribute 'get_extra_actions'

I have a small web app, and I'm trying to develop an API for it. I'm having an issue with a model I have called Platform inside of an app I have called UserPlat

Disable pagination inspector on drf_yasg

I'm using drf_yasg to create my swagger document but I have an issue with PaginationInspector. In one of my views I declare a paginator and in swagger, is shown

Is there a Django library that automatically display local currency based on a visitors country IP address

I'm trying to integrate a functionality on an Ecommerce website in Django, Where visitors are automatically shown local currency base on their country IP addres

I would like to run for loop to each of li tag and want to add content dynamically from django backend admin

I have created a navbar and content can be added from the backend but only the home nav bar shows the icon and the other navbar name is with the same icon. I wa

Django: how to count the ratings and reviews of a post using django?

i have a model course and i also have a model review and rating that allows users rate a particular course. now i want to count all the ratings on each course w

DRF-simple-JWT: New user registered but not able to login

I am able to create a New User using the "register" endpoint. I can the user being created on the admin page as well. When I try to get an access token for the

How to deduct funds from users withdrawals in Django Rest Framework

I am building a logistics web application using DRF and i want to set users to withdrawal certain amount, let's say a users withdraw $200, i want the users to g

How can we add more than 3 authors field for a single magzine? in Django models

I created a magzine model in django. But their are more than three authors of a magzine. I have written below code for three authors. If I write the code of two

DRF --405 Method not allowed for update operation

I have done this before and may be it did work properly that time but now suddenly it's not working as it's expected to be. The viewset.py: class ProfileView

Images are not rendering on Django template from a multi-model view

Problem: I cannot get images to appear on my template plant_detail.html. I think I'm calling on variables incorrectly, but not sure what to change. Context: I c

ImportError: cannot import name 'url' from 'django.conf.urls'

ImportError: cannot import name 'url' from 'django.conf.urls' (/home/chams/pfe_project/CarApp/venv/lib/python3.8/site-packages/django/conf/urls/_init_.py) I can