I am currently utilizing Django Rest Framework for my login API. I am looking to only allow certain group users to login through the API. I have set up a group and assigned users to that group. I have created a permission class and applied it to my APIView ...
When it comes to backend operations, I have integrated the PageNumberPagination as the DEFAULT_PAGINATION_CLASS. Since I am utilizing vue.js along with fetch, there is no need for me to include the entire URL structure provided by django-rest-framework: " ...
Struggling to properly title this question, but please bear with me as I explain my dilemma. I am in the process of creating an app for my hockey team that involves a django backend and a mobile app using JSON communication (via django-rest-framework). On ...
I have set up an API using Django-REST Framework and am currently working on connecting it to my frontend. One of the endpoints I created retrieves the last four winners, and when I test it, everything seems to be functioning properly. async function getL ...
I'm facing an issue when trying to serialize a simple data object to JSON in Python. I keep getting the error message "TypeError: <api.tests.MemberInfo object at 0x02B26210> is not JSON serializable." Here's the object I'm attempting to serialize: ...
Our Django App uses REST Framework in a setup with nginx, redis, celery, gunicorn, and PostgreSQL. The system consists of only one App server. For ajax calls, we utilize the following function : $.ajaxSetup({ beforeSend: function (jqXHR, settings) { ...
How can I include an API key in the header of a Vue.js request? I am using DRF pagination. methods: { getPostData() { axios .get("http://192.168.43.126:8000/api/?page=" + this.currentPage, { headers: { &q ...
My LMS application is built using Django REST and Vue.js. I authenticate users through Google OAuth2 by: utilizing drf-social-oauth2 on the backend with Google as the authentication provider implementing this wrapper for gapi on the frontend The user cli ...
Seeking assistance with filtering my APIListView by a specific PK value provided in the URL. Despite having data at the specified PKs, the API output is empty. Any suggestions? Models.py class Item(models.Model): Description = models.CharField(max_le ...
After conducting tests on Postman, I received the correct response. However, upon deploying the code for the frontend team, they reported that it consistently returns false... views.py # Verify authentication status def verify(request): info = {} ...
I have a question about developing a full-stack app. Currently, I am using a Next.js React app on the frontend and a Django app with a PostgreSQL database on the backend. There are two main approaches I have seen to integrate all of these components seaml ...
I have the following urlpatterns: urlpatterns = [ url(r'^tools(?:/tool_one=(?P<tool_one>w+))?/?$', views.ToolsViews.as_view(), name='tools'), ] This results in a URL like this: tools/tool_one=bags I want to add a question mark to the U ...
Feeling a bit lost on how to handle form processing with django, django-rest-framework, angularjs, and django-angular. By using traditional Django techniques, I can generate a model form in my view and pass it over to my template. With the help of django ...
Currently, I am collaborating on a compact university venture utilizing Vue JS, Django2, and Django Rest Framework. The project involves two distinct user roles with varying actions within the application. The aspect that is leaving me puzzled is the logi ...
Currently, I am developing my Django DRF application and dealing with two models - Organization and BankAccount class Organization(models.Model): ... class BankAccount(models.Model): is_main = mode ...
I am looking to establish a model (Source) with a many-to-many relationship to another model (Tag) and create Source objects without duplicating Tag instances in the database. Below are my models: class Tag(models.Model): name = models.CharField(max_l ...
When referring to the Wagtail documentation, there is a specific section dedicated to the exclusion of certain fields from the API (). The focus is on how to remove these fields from the perspective of the API consumer by using the URL query parameter ?f ...
I currently have these API endpoints set up: urlpatterns += [ path('api-token-auth/', obtain_jwt_token), path('api-token-verify/', verify_jwt_token), path('api-token-refresh/', refresh_jwt_token), path('api/', include(router.urls)), ] For ...
As a newcomer to Django and WordPress, I have encountered an issue while making an API request from HTML-Javascript code embedded in my WordPress page. The API request goes through successfully and is processed by the Django-rest-framework backend, however ...
Consider the following JSON structure: { "timesheets": [ { "user": { "username": "erik", "first_name": "Erik", }, &q ...
I have encountered a strange issue while building my ecommerce site. Everything seems to be working fine, except for the forms. When attempting to post content, I keep receiving a 405 method get not allowed error. It's confusing as I am trying to use the P ...
The mobile authentication detection feature suddenly stopped functioning. Whenever I navigate to a page with a form, the form should make an ajax call to fetch additional information for populating the fields based on user authentication. This process work ...
Currently, I am actively involved in a project combining Django with React. Through using DRF, I have implemented an API route to execute SQL queries on my PostgreSQL database. However, encountering obstacles with the current code arrangement. In my setup ...
Recently delving into DRF (and Django), I am tackling the challenge of creating a nested serializer to validate the following request data: { "code": "12345", "city": { "name": "atlanta", "state": "Georgia" }, "subregion": ...
Just starting out with django. Using: oAuth2 + PKCE protocol, Angular, Django-oauth2-toolkit + REST Continuously receiving this error: oauthlib.oauth2.rfc6749.errors.InvalidRequestError: (invalid_request) URL query parameters are not allowed <oauthli ...
I am working with two different endpoints and I need to fetch data from both simultaneously in order to display it in one single element. For example, I want to show data from one table along with the corresponding name from another table if the product id ...
I'm currently working on my first React API application and I am facing an issue where the state data appears to be empty even after assigning res.data, which is not empty. Additionally, I am struggling with rendering all of this content inside a div. Whe ...
Working on developing a REST API for managing geo-related data. The front-end developer is requesting the centroid of polygons in geoJSON format based on zoom level. Here is the structure of my polygon model: ... from django.contrib.gis.db import mode ...
My Django application, which utilizes pandas processing code, is encountering an issue on a specific page when deployed on the service. It consistently presents an application server error, despite functioning properly on a local server. However, it takes ...
I recently integrated Google Login into my web app which has a React front-end and Django backend. In the front end, I utilized the react-google-login package to manage all authentication processes, while on the backend, I implemented django-allauth with s ...
I've created an API hub using Django and a frontend application with NextJS. Currently, I'm working on implementing authentication from the NextJS app to the Django API and I'm seeking advice on best practices. At the moment, the NextJS app ...
I am currently exploring ways to document my API using the swagger generator tool called django-rest-swagger with DRF. At the moment, I am creating views by extending the rest_framework.views.APIView. I prefer not to use viewsets or serializers for writi ...
I want to integrate the bootstrap-table plugin with server-side functionality using Django Rest Framework to populate the data on the table. However, I keep getting the message "No matching records found". After some investigation, I discovered that a spec ...
Is there a way to serialize the get_picture(self) method within this model? I am currently working on a social networking project and I need to serialize this method in order to obtain a JSON URL for the user's profile picture to be utilized in an And ...
After successfully developing and deploying a Django REST API on Heroku, I encountered an issue when trying to fetch the API in Vue CLI. I received a CORS error message, prompting some questions to arise: Should I enable CORS in the backend using a CORS ...
I am currently working on a project involving Django, Django REST, and Vue JS. I have successfully managed to retrieve information from the API to the Vue JS frontend. However, I am facing an issue where data is not being posted to the Django database when ...
I am facing an issue where I am trying to retrieve data of a single product from "api/products/id" using Django Rest Framework and store it in the Redux state. However, when I refresh the product's page in my React application by going to "localhost:3000/p ...
Working on a new project utilizing the Django REST API framework. Encountering an error when running the project locally: File "/home/asad/PycharmProjects/microshop/venv/lib/python3.8/site-packages/rest_framework/routers.py", line 153, in get_rou ...
Recently, I've been working on developing a DRF API integrated with an Angular front end for one of my ongoing projects. Specifically, I have created serializers for User and Device. However, during the process, I encountered an error related to Stati ...
How can I implement nested categories in Django? I am new to Django and have been trying to set this up, but the solutions I found didn't seem to work. class MainCategory(models.Model): name = models.CharField(max_length=50) date_created = models ...
I'm having an issue with retrieving a filtered list from my MySQL database. The query seems correct, but the JSON output is not as expected: [ { "id": "0038", "name": "Jane Doe", "total_hrs_per_wee ...
I am currently working on a project that involves using Django REST for the backend with Flutter dropdown widget to display a list of Country states. However, I am facing challenges in getting the list of states to appear in the dropdown menu. Can anyone p ...
I am just starting out with Django Rest Framework (DRF) and AngularJs. I am trying to figure out the best way to integrate these two technologies. Combining DRF and AngularJs in one project (Most of the tutorials recommend this) Using DRF as the backend ...
When the addmorefield button is clicked on this form, two more fields with the same name are appended: <form method="post" id="sampleform" action="#"> <div class="input_fields" style="text-align:center"> <input type="text" name="first_name ...
Utilizing Django in conjunction with Django Rest Framework, I have made the browseable api inaccessible in the settings.py file. Despite this configuration, when I navigate to http://example.com/api - with "example.com" representing my domain - I encounter ...
Imagine having a front-end application built in React and a back-end application developed using Node.js with Express. The back end has been thoroughly tested with Mocha, and now it's time to create functional tests for the front end. However, since the fr ...
Currently, I am utilizing Axios to transmit user input to a DRF API, which then returns an authentication token. This token is being saved in the Vuex store. However, when I attempt to request another API endpoint using Axios with the most recent token in ...
I'm currently working on setting up a nested JSON file in Django Rest Framework. I've been researching different approaches to properly nest my serializers, but haven't had much success. I'm struggling with creating a model serializer from scratch instead ...
Currently, I am in the process of learning about DRF. One thing I attempted was to print out print request.query_params, but unfortunately encountered an error: print request.query_params AttributeError: 'WSGIRequest' object has no attribute 'query_pa ...
After developing a web application using Django Rest Framework and React, I faced an issue during deployment on IIS. While the deployment is successful, I encountered a problem with the Django Admin where the styles were not displaying properly. This led t ...
For my project, I am utilizing React as a standalone Single Page Application (SPA) that connects to a Django backend with allauth for authentication management. When I enter the URL on my local browser (192.168.86.28:8000/accounts/signup/ or 127.0.0.1:8000 ...
I need assistance with sending an array of images in a JSON format. My desired output is: {"id":1,"timeIntervel":4,"images":["http://127.0.0.1:8000/images/i1.jpg","http://127.0.0.1:8000/images/i2.jpg","http://127.0.0.1:8000/images/i3.jpg","http://127.0.0. ...
I am attempting to utilize the Advanced serializer method outlined in the Django Rest Framework documentation. in order to dynamically modify a serializer field. Below is my customized serializer class: class FilmSerializer(serializers.ModelSerializer): ...
I've integrated djangorestframework for my api and am currently developing an Android App that interacts with the api by fetching and posting data. I'm interested in finding a way to detect changes in json data from the api. For example, in a chat applic ...
I have created a DRF API View in my Django project to manage Withdraw records. Below is the implementation: class WithdrawListCreateAPIView(PartnerAware, WithdrawQuerySetViewMixin, generics.ListCreateAPIView): permission_classes = (TokenMatchesOASRequi ...
Has anyone else experienced an issue with the styling in their Django admin panel? The CSS appears to be functioning properly, but once you navigate to a specific model, the layout becomes distorted. I can't seem to figure out what could be causing this ...
Hello, I am working with Docker and DRF, and facing some challenges. Initially, I executed this command: pip install -r requirements.txt --use-deprecated=legacy-resolver Below are the contents of my requirements file: asgiref==3.5.2 backports.zoneinfo==0 ...
I am currently developing a Nuxt.js/Vue frontend for my Django Rest Framework backend. Despite specifying permissions to allow non-authenticated users to read-only, I am having trouble successfully loading data from my API. Index.vue import axios from &a ...
My Django Rest Framework function has the following structure: @api_view(['GET', 'PUT']) @permission_classes((permissions.IsAuthenticated,)) def TestView(request, app_id): return Response({}) It is supposed to always generate a JSON response with an em ...
Looking to showcase JSON data in a ListView on an Android application. Utilizing Django Rest Framework, I have successfully serialized my objects and transformed the information into JSON format which can now be accessed through 127.0.0.1:8000/. Below are ...
While trying to post data from Angular formData to a Django REST API, I encountered an error saying "Incorrect type. Expected pk value, received str." Here is how I am currently sending the data using form data: let noticeData = this.announceForm.value; i ...
Currently, I am in the process of developing an API using Django-Rest-Framework and I have implemented cursor pagination which is by default ordered by the 'created' filter. This setup has been working well for most of my views. However, I have ...
Currently, I am working on developing a referral system logic in Django. The referral system is functioning properly at the moment, but I have a new requirement to implement. When I refer both "user 2" and "user 3", the system records that I have referred ...
In my project, I am utilizing the APIView alongside custom pagination. Although it is functioning properly, I am encountering an issue where the same elements are being displayed multiple times. Below is what I have attempted so far. views.py class Produ ...
I am facing an issue while trying to allow a user to create a new list for a dashboard. The problem arises as follows: User creates the first list: The new list appears once User creates a second list: the second list appears twice User creates a third li ...
When implementing JWT authentication using username/password, the process goes as follows: from rest_framework_simplejwt.serializers import TokenObtainPairSerializer '''The POST request appears like this: <QueryDict: { 'csrfmiddlewaretoken': ['Pd1 ...
Currently, I am tackling my first major project and grappling with the integration of Django with ajax. My website features multiple standalone services written in JavaScript, however there are instances where information needs to be sent to the server. Ad ...
Trying to set an identifier for a CSV file's name so that clicking on a link next to it will lead to viewing the file itself on another webpage. Encountering the error message 'QueryDict' object has no attribute 'objects' Please note: CSV files are colle ...
I'm currently working on an Android app that has a backend hosted on a Heroku free server. The current response time for serving requests is 2 seconds. I'm curious to know how many users it can handle simultaneously. I've searched through various Quora qu ...
For some reason, my app is no longer allowing users to log in after making changes to their profile. I have a nested User serializer with the profile serializer fields (one-to-one relationship) using Djoser for the urls. When attempting to update the user ...
I have a collection of tags in an object, and I want to dynamically add new tags before submitting the form. Despite using vue watch, it doesn't seem to be working for me. Here is the code snippet: data() { return { blog: { blog_title: ...
Currently, I am in the process of developing a poll application that utilizes both Django and React. My approach involves using the fetch API to send POST requests to my Django server and receive detailed information in return for further processing. For a ...
I've been grappling with this issue for the past three days without any luck in finding a solution. My Nuxt.js frontend relies on the auth module to acquire a JWT token from a DRF backend. Upon logging in, the server returns the following message: Forbidd ...
I have a frontend application built with React Framework that I want to provide access to via a time-limited personal link, without the need for additional authentication functions. With approximately 1-2 new users per day, my proposed implementation is as ...
My technology stack includes Django for the backend with Django Rest Framework and Angular for the frontend. Within the backend, I have defined 2 models: class Post(models.Model): category = models.ForeignKey(Category, on_delete=models.SET_NULL, null= ...