Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
0 replies
21 views

Django's http response.py library provides an Http404 class that can be used to raise a "not found" exception which returns a 404 along with the following JSON payload: {"detail":&...
jpro's user avatar
  • 364
0 votes
0 answers
52 views

I have a Django Admin setup where a Marketing user should only be allowed to view Clients and Therapists. However, even after removing all permissions related to UserIncomeSupportDocument, the ...
Raza Khalid's user avatar
2 votes
1 answer
101 views

This import in urls.py... from drf_nested_routers import DefaultRouter as NestedDefaultRouter ...gives me an error: Import "drf_nested_routers" could not be resolved However, ...
Juan's user avatar
  • 11
-1 votes
1 answer
81 views

I am working with a DocuSign sandbox (developer) environment to integrate embedded signing and webhook functionality into a Django REST Framework application. Initially, I was able to send envelopes ...
K Vinay's user avatar
Best practices
1 vote
5 replies
109 views

I’m building a small “newsroom” application where Django handles the backend (API, authentication, admin) and Vue 3 handles the frontend UI. I’m still fairly new to combining Django with a modern ...
Random3c0d3's user avatar
-3 votes
2 answers
99 views

What is the difference between decorator @api_view and @csrf_exempt in project level django rest framework? I need the difference and which is better to develop the project.
Sanjay N's user avatar
2 votes
2 answers
70 views

I have a Django REST project where I created a directory called apps to store all my apps. Each app is added to the INSTALLED_APPS list in my settings file like this: INSTALLED_APPS = [ 'django....
Ali Motamed's user avatar
1 vote
1 answer
80 views

I'm encountering a persistent 403 Forbidden error with the detail: CSRF Failed: CSRF token missing. This happens when trying to obtain an authentication token using Django REST Framework's built-in ...
mohsen's user avatar
  • 11
2 votes
2 answers
67 views

I have a Django project with DjangoRestFramework. I have a simple view, Facility, which is a ListAPIView. Permissions were generated for add, change, delete and view. I have create a new user, and ...
Mathijs van Nimwegen's user avatar
0 votes
1 answer
65 views

I am making a back-end system using DRF in Django. This is my first project in Django and DRF. I am using Django purely as a REST back-end I am making a quiz/mcq application This is from my questions ...
Sam8848's user avatar
4 votes
1 answer
108 views

I am an intern at a company and we are using django as framework. I was working on a two part register system in which an admin performs the initial registration after which a link is sent to the user ...
Parsa Ghost's user avatar
-1 votes
1 answer
57 views

I was working on notion like app, so I have a Note(consider as a Page in notion) and in that i am having blocks, where block having different id's and held with Note in Foreign field so now in views ...
sbnd abhijeet's user avatar
0 votes
0 answers
61 views

I would like to ask about a certain topic that is tough one. Im working in a project that has microservices architecture with more than 1 databases running every time. in django, how can I perform ...
0 votes
1 answer
70 views

What are the details of your problem? I have a application in Django that is deployed using GKE. It uses an ingress to deploy it... Those manifests.yml that are used for deploying applications on ...
Raul Chiarella's user avatar
0 votes
1 answer
160 views

I have a serverless pipeline on Google Cloud. It consists of three total steps: A video uploader that sends videos to Google Cloud Storage. Working fine. An eventarc + pub/sub trigger that fires ...
Raul Chiarella's user avatar
1 vote
0 answers
38 views

I have a Django API that returns self signedup users in a given date range. The AuditLog model stores timestamp with DateTimeField(default=timezone.now) and USE_TZ=True. Locally, the date filter works ...
Manish Shrestha's user avatar
1 vote
0 answers
101 views

I have a very simple view that Streams a repsonse. When using python manage.py runserverthe stream works as expected. But, when we use uvicorn app.asgi:application or daphne app.asgi:application or ...
Diogo Dias's user avatar
1 vote
0 answers
96 views

I’m working with Django REST Framework and django-filter to implement API filtering. I created custom serializer fields (for example, a JalaliDateField that converts between Jalali and Gregorian dates,...
PooyaAbbasi's user avatar
0 votes
1 answer
131 views

Context: I'm setting DRF + dj-rest-auth + allauth + simple-jwt for user authentication. Desired behaviour: Register with no username, only email. Authorize login only if email is verified with a link ...
Oliver Mohr Bonometti's user avatar
0 votes
0 answers
40 views

My backend has an endpoint: /auth/jwt/create that returns a JSON response containing the access and refresh tokens. With my current backend setup, I send the tokens in both the response body and in ...
sodiumfish's user avatar
0 votes
2 answers
226 views

In my React + Django project, I’m currently sending the refresh token as an HttpOnly cookie. The problem with HttpOnly cookies is that they are automatically sent by the browser, which makes them ...
Sibi K's user avatar
  • 9
0 votes
1 answer
139 views

I’m trying to apply custom throttling for the signup endpoint in my Django REST Framework API. The goal is to allow only 5 signup attempts per hour for anonymous users. I created a SignupRateThrottle ...
Adebola Ajewole's user avatar
-1 votes
1 answer
152 views

i am making an API with django rest framework and django 5.2 when i send a POST request, if i be logged in it gives me an CSRF token missing error. but if i be logged out it gives me response with no ...
parham ardeshiri's user avatar
0 votes
2 answers
266 views

For my Django projects, I am used to creating a custom user model and managing what my user can do for a specific route using a roles field like this: class User(AbstractBaseUser, PermissionsMixin): ...
Fazle Rabbi Faiyaz's user avatar
0 votes
1 answer
94 views

I have a Django 4.2 app with Postgres DB and REST API. My urls.py contains this path in urlpatterns: path('create/<int:pk>/<str:name>/', ComponentCreate.as_view(), name='create-component') ...
Paul Sandie's user avatar
1 vote
2 answers
105 views

I'm using Django and Stripe for a multi-tenant SaaS. I register users and organizations manually from a view, and I create the customer and subscription using Stripe API before saving to the database. ...
Br0k3nS0u1's user avatar
1 vote
0 answers
62 views

@transaction.atomic def deposit(user: User, account_number: str, amount: float) -> None: account = get_object_or_404( Account.objects.select_for_update(), account_number=account_number, ...
Jueun's user avatar
  • 11
-1 votes
1 answer
79 views

The backend works, when i test it with an http file. and directly at the endpoint. POST http://localhost:8000/api/products/ HTTP/1.1 Content-Type: application/json Authorization: Bearer ...
M.creations's user avatar
0 votes
2 answers
161 views

I am using the Django REST Framework with dj-rest-auth and django-allauth for authentication and authorisation with JWTs. From what I have heard, using HTTP-only cookies to store the tokens is a ...
Sebastian Power's user avatar
0 votes
0 answers
114 views

file models.py ANIMATIONS_ACTIONS = ( ('0', _('Stop animations')), ('1', _('Start animations')), ('2', _('Restart animations')), ('3', _('Suspend animations')), ('4', _('Unload ...
Franc SERRES's user avatar
0 votes
1 answer
90 views

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 ...
Raul Chiarella's user avatar
0 votes
2 answers
79 views

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 ...
Human's user avatar
  • 27
2 votes
1 answer
46 views

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 = ...
Pier1 Sys's user avatar
  • 1,320
1 vote
1 answer
47 views

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) ...
raza hussain's user avatar
1 vote
1 answer
38 views

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 ...
Daniel F.'s user avatar
  • 1,800
1 vote
2 answers
148 views

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 ...
Tio's user avatar
  • 1,022
1 vote
1 answer
54 views

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 ...
kryx's user avatar
  • 108
1 vote
1 answer
74 views

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 ...
Raul Chiarella's user avatar
0 votes
1 answer
72 views

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 ...
Raul Chiarella's user avatar
0 votes
1 answer
58 views

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 ...
Emre Tapcı's user avatar
  • 1,938
1 vote
1 answer
67 views

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 ...
Anton's user avatar
  • 135
1 vote
1 answer
88 views

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), ...
kryx's user avatar
  • 108
0 votes
1 answer
77 views

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 ...
Benedicto macha's user avatar
3 votes
3 answers
47 views

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, ...
Emmanuel Rusiana's user avatar
0 votes
1 answer
66 views

I have a social network project for users to share their recipes. The Recipe objects managed by a ViewSet, which has Serializer, where create and update recipes operations defined, via POST and PATCH ...
user30835942's user avatar
0 votes
1 answer
37 views

I'm building a marketplace app (think classified ads with negotiations) and trying to implement a personalized recommendation feed. I have a hybrid architecture question about the best way to handle ...
Leroy Mapunzwana's user avatar
2 votes
2 answers
703 views

I'm working on a Django project using django-allauth and dj-rest-auth for authentication. I've set up a custom user model (CustomUser) where email is the USERNAME_FIELD and username is set to None. I'...
Md Roni Ahamed's user avatar
1 vote
2 answers
110 views

Hello I'm working on making all urls requires user to be authenticate , but some urls i want them to be accessible by public, so i use permission_classes = [AllowAny] and authentication_classes = (...
urek mazino's user avatar
0 votes
2 answers
117 views

I have an issue with DRF, CursorPagination and Filters. I have an endpoint. When I access the initial page of the enpoint I get a next URL "next": "http://my-url/api/my-endpoint/?cursor=...
Martin Taleski's user avatar
2 votes
1 answer
47 views

I'm using DRF and NextJS(app router) to build an application with a search feature that saves the authenticated user's search history. The search history is their search terms with a timestamp and ...
user3125823's user avatar
  • 1,958

1
2 3 4 5
635