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
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
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
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' (/home/chams/pfe_project/CarApp/venv/lib/python3.8/site-packages/django/conf/urls/_init_.py) I can
class RegisterViewSet(viewsets.ModelViewSet): http_method_names = ["post"] permission_classes = (AllowAny,) serializer_class = RegisterSerializer
I've been trying to make a custom class/type, defined in a separate db.py file, to be properly serialized as an int when doing a manage.py dumpdata command, but
I have a Cart model and Cartserializers. I am trying to do that is if cart defects exist in the cart and then update the cart by increasing the quantity of cart
I am developing an API in DRF and have stumbled upon one issue that hopefully you can help me to solve. Let's assume I have the following model and a serializer
If I have 1 model with 3 different geo_fields in (point, poly and line), can I serialize all of these with django-rest-framework-gis? My model: class Job(BaseMo
Quick question: I know that Django has some baked-in security at different system levels, but I'm not sure if accessing the the request.data property directly s
When a user creates a user record for a client, the new client should should have the current logged in user's User.user_company value. In the problem here, I w
I'm to update the frontend of this site https://github.com/ildebr/store-repository it has a react frontend and a Django backend, auth is made with Django-rest-f
This is my project structure. I am trying to access settings.py file from lookups.py I am importing using following code, import os import sys import django sy
I want to have a default value in my django model response value Sample model query myModel.objects.filter().values("username", "user_gender") I want to have a
When using more complicated representation schemas (e.g. nested objects and lists), the "HTML" form part of the Browsable API in Django REST Framework becomes m
Okay so I need to have my field have a maximum of 10 integers allowed to be entered. I tried MaxValueValidator but I figured out that this just needs a value th
I'm rather confused regarding the following error: "Forbidden (CSRF cookie not set.)". This error is received during attempting to logout, login, signup. The pr
models.py def upload_org_logo(instance, filename): ts = calendar.timegm(time.gmtime()) filepath = f"Timesheet/org_logo/{ts}" if instance: b
I am trying to filter my data with a date-time field, but in my case its not working. So please someone suggest to me how can I filter my date with time start_t