skip to Main Content

Html – Django Template how to get the value of a model through the OneToOneField

In my Django App i have Two Models and the User model from django.contrib.auth.models from django.contrib.auth.models import User class Room(models.Model): host = models.ForeignKey(User, on_delete=models.CASCADE, null=True) topic = models.ForeignKey(Topic, on_delete=models.SET_NULL, null=True) name = models.CharField(max_length=200) description = models.TextField(null = True, blank =…

VIEW QUESTION

Javascript – Can't convert a HTTP response to JSON

I'm fetching my own API, fetch('/guidebook/api/peak-data/') .then(response => response.json()) .then(response => JSON.stringify((response))) .then(data => { console.log('Raw JSON data:', data); console.log('Type of data:', typeof data); console.log('Type of features:', typeof data.features); }) .catch(error => { console.log('Error:', error); }); The data come from…

VIEW QUESTION
Back To Top
Search