Questions tagged django-rest-framework

Explore the latest questions and answers asked by our top developers.

How to hose a Django Angular 12 PWA on Digital Ocean

I currently have a Django PWA application on DigitalOcean. In DO, I am using the app and I connected it to my GitHub. I want to separate the backend from the frontend and user Django Rest Framework and Angular 12. What is the best way to go about doing this? I can create a Django-Angular […]

How to implement Angular with Django

I have requirement for creating an application using Angular(TypeScript) as frontend and Django as Backend, where I will be working only on Django (backend). Is that creating an REST API only enough to communicate with front end. Is that only possible in the backend in this case? Normally while working in Django I used to […]

By imran 44
Published
Categorized as angular, django, django-rest-framework Tagged , ,

Django+Angular 2 in one port

I am new in python and django. I want that my django project work with angular 2 in one port (for example localhost:8080). I visit many page, but I don’t find project django that’s work with angular 2 in one port. Please help me find simple project django that’s work with angular 2 in one […]

By
Published
Categorized as angular, django, django-rest-framework, python Tagged , , ,

API request saying not found

Trying to get product detail from django rest framework. However whenever try: baseurl = "http://127.0.0.1:8000" httpHeaders = new HttpHeaders({‘Content-Type’: ‘application/json’}) constructor(private http: HttpClient) { } getAllProducts(): Observable<any>{ return this.http.get(this.baseurl +’/product/’, {headers: this.httpHeaders}) } getProductDetails(slug: string): Observable<any>{ return this.http.get<any>(`${this.baseurl}/product/${slug}/`, {headers: this.httpHeaders}) } i get an error saying: Not Found: /product/[object Object]/ [20/Oct/2021 21:54:32] "GET /product/[object%20Object]/ HTTP/1.1" […]

How to display product details from django restframework to angular?

I am trying to navigate into my product details, however not getting any response from my api. May i have you assistance please? django views: class Product(generics.RetrieveAPIView): lookup_field = "slug" queryset = Product.objects.all() serializer_class = ProductSerializer django urls: path("product/<slug>", views.Product.as_view(), name="product_detail"), angular api.service: import { Injectable } from ‘@angular/core’; import { HttpClient, HttpHeaders } from […]

How to iterate values sent from a django restframework in angular12

trying to display the category of my product. However it is only showing the id number for the category, and if i enter {{category.name}} it shows nothing. The category is a foreign key for the product model class. Here are the Angular html and ts components: export class GroceriesComponent implements OnInit { constructor(private service:ApiService) { […]

how to post list data in string or int data in rest api from angular formData

I was posting data from angular formData to django rest API but I am getting an error "Incorrect type. Expected pk value, received str." here how I am sending data by using form data let noticeData = this.announceForm.value; if (noticeData.students.includes(‘all’)){ noticeData.students = noticeData.students.filter((s) => s != ‘all’) } noticeData.students = JSON.stringify(noticeData.students); not working I need […]

how to pass input to api from angular forms without formControlName?

I am passing some data from angular to django rest api, Which is as follows first what django need in for api: notice { description: something, classname : in which class notice is provided, students : from dropdown } what I am passing from angular description by formController students by formcontroller now my issue is […]

“EXPECTED A LIST OF ITEMS BUT GOT TYPE “STR”.” IN DJANGO REST FRAMEWORK it is solving but angular show in id but i want show group id =name?

enter image description here enter image description here Please, anyone, help me Groups <select id="groups" name="groups" [(ngModel)]="user.groups" class="form-control"> <option *ngFor="let group of Groupslist" value={{group.id}}>{{group.name}} I want to send it possible to anyway in postman or angular. { "email": "[email protected]", "first_name": "myfirst_name", "last_name": "mylast_name", "phone": "000556660", "address": "myaddress", "password": "mypassword", "group_id": 5 } above in "group_id":5 […]

By MOHAN SUNKA
Published
Categorized as angular, django-rest-framework Tagged ,

How to Display Posts and Post content/Body on the same Page in angular

Im Building a simple website in angular which has few Categories and each Category has few Posts… I want to display all the post titles linked to particular category in sidebar and the post content of every Post in the div adjacent to sidebar…Im using django rest framework for API’s.. Everything is working fine until […]

1 2 3 10

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq