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
I am trying to add a filter on an existing queryset based on a condition but it doesn't work. This works queryset = None if self.is_instructor =
i have a model class Category and also a model class Course. i want to count all the courses that are related to a model e.g: Web Devlopment - 26 Courses i dont
i want to create chat app, i follow the https://channels.readthedocs.io/en/latest/tutorial/part_2.html here, chat/ __init__.py routing.py urls.py
I just finished implementing Google social authentication in my NextJS + DjangoRest project following this blog post. I am trying to figure out how to make prot
I haved Format_List model with relation with Django user and now I want to get the data belongs to specific user by giving user id or after user login. models.p