Questions tagged django

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

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 […]

hosting django with angular on digitalocean with nginx

I have a Django-Angular project which I want to deploy on DigitalOcean with Nginx and I am successful in running the whole setup, but I have some doubts that I want to clear before finally proceeding with this solution. This is what I’ve done so far Currently, I’ve gunicorn.sock and gunicorn.service files to set up […]

By danish2694
Published
Categorized as angular, digital-ocean, django, nginx Tagged , , ,

how to pass data in array to post method in angular and django?

I am trying to pass a list of student IDs but it is not working. from angular I am passing dataas follows let noticeData = this.announceForm.value; if (noticeData.students.includes(‘all’)){ noticeData.students = noticeData.students.filter((s) => s != ‘all’) } noticeData.students = JSON.stringify(noticeData.students); from django i am reading and trying to store data as Below is the to_internal_value method […]

Read value of an html script element in Angular, which is of type json

In the html page, there will be a script element which is a static content ( generated from a Django backend) with an ID. <script id="hello-data" type="application/json">{"hello": "worldu003C/scriptu003Eu0026amp;"}</script> I wanted to get that data in an angular service ( or even component) which would have a simple getElementById is javascript. const value = JSON.parse(document.getElementById(‘hello-data’).textContent); I […]

By A J
Published
Categorized as angular, django, getelementbyid, javascript Tagged , , ,

Django BooleanField in Angular

I am building an App with Django as my backend and Angular as my frontend. In Django I have a BooleanField for my class "Employee". They can tick, if they are planning on being retired in 5 years or not: class Employee(models.Model): name = … retired_5 = models.BooleanField(default = False) I have serialized my class […]

Javascript – how to display the list of items based on the user in the search box

I have a django web page where user can registered and below there is a table, which display the list of users from the database in the table. I have created a search box when user types the username, that particular username should reflect in the table.I’m trying this with Js script I’m not much […]

By imran 44
Published
Categorized as angularjs, css, django, html, javascript Tagged , , , ,

Javascript – how to display the list of items using the search box from the user’s input

I have a django web page where user can registered and below there is a table, which display the list of users from the database in the table. I have created a search box when user types the username, that particular username should reflect in the table.I’m trying this with Js script I’m not much […]

By imran 44
Published
Categorized as angularjs, css, django, html, javascript Tagged , , , ,

Weird Django & Angular "No ‘Access-Control-Allow-Origin’ header is present" when deployed on Cloud server with Nginx

I seem to have a problem with the "No ‘Access-Control-Allow-Origin’ header is present on the requested resource" on my deployed app. When I am testing these on my localhost:4200 which is angular and localhost:8000 with backend, it works perfectly fine. Below are the Localhost screenshots now this are the deployed angular app What’s really weird […]

By patz
Published
Categorized as angular, cloud, django, nginx Tagged , , ,

Math calculations – backend or frontend

I am creating a web application(Django + Angular) whose main purpose is to draw shapes. I calculate and draw all the shapes myself. Where is it better to do the calculations (calculating line equations, finding common points)- on the backend and ask the server or on the frontend? Thanks Source: Angular Questions

By Karol Janic
Published
Categorized as angular, backend, django, frontend Tagged , , ,

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 […]

1 18

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