Category "django"

ReactJS / Axios / Django: Update form with the current image from API

I'm trying to create an update form in React, the update works fine as I have set the default values that coming from (get method) using axios and set them as t

Using forloop.counter to iterate over list in django template

I have a list of objects named chargers_list and on my view I estimate when will the charging be done. List of estimates is the same size and is named eta. I it

How can I add two related nested instance in one request using DRF?

Hi I'm new to Django rest framework I have two models: class Location(models.Model): name = models.CharField(("name"), max_length=50) long = models.Char

Django's infinite streaming response logs 500 in apache logs

I have a Django+Apache server, and there is a view with infinite streaming response def my_view(request): try: return StreamingHttpResponse(map(

unhashable type 'list' when i enter on change_list in Django

I search for days for a solution for this problem. after touching the admin.py file to override the get_queryset and get_form methods I ran into the unhashable

Unable to serve static file in Django deployed to production in Digital ocean

Currently I deployed my django app in Digital ocean droplet. In localhost it works well but it cant serve js/css files in static folder when deployed to prod. H

How can I add ordering for ManyToMany field?

I have two models: CustomUser and AgreementReglament At this moment relation between the models looks like this: class AgreementReglament(models.Model): nam

I display a table with ajax in real time and I check some lines which I return in my views

I have this problem in summary: when i fill my input automatically i display an array using ajax , and on the same table I shock a few lines and when I send bac

Django heroku push gives could not build wheels for backports.zoneinfo error

I am trying to push a django project to heroku. heroku create worked fine but when trying to push to heroku main I get the following error. ''' Enumerating obje

Adding markdown highlighted fenced block to django app with markdonx

I have been looking through the documentation but I can’t seem to get this to work. I wish to publish posts from a “creation page”. I want to

Pytesseract - using .traineddata file on hosted server (Heroku)

I have a Vue, Django integrated project. I hosted the Vue project on Netlify and the Django project on Heroku. A python script (integrated into Heroku) is calle

Django form with dropdown list using Database returns empty fields

I'm discovering Django and I'm trying to develop a simple application. I have three tables in my database : One big table to report all the information to users

Django and Axios Forbidden (CSRF token missing or incorrect.)

I am having issue with my django server when trying to connect it to axios. It should be a simple fix but I am stuck! I am getting this error from my django ser

in Django : Why nothing happens when I try to Create new note with the html form in the notes.html page

I've just started my first app with Django by following a video on YouTube. The app is a students dashboard with 8 tools and features to help the student to mak

django.core.exceptions.ImproperlyConfigured error

Here is the error message: django.core.exceptions.ImproperlyConfigured: The included URLconf '<module 'basicsiteApp' from '/Users/msa/trydjango/basicsite/ba

Cann't install django with error 'Non-zero exit code (2)'

When i create new django project in pycharm i have error enter image description here Help me please

Django cache real-time data with DRF filtering and sorting

I'm building a web app to manage a fleet of moving vehicles. Each vehicle has a set of fixed data (like their license plate), and another set of data that gets

FieldError at /teacher/8/. Cannot resolve keyword 'teacher' into field. Choices are: classroom, faculty, faculty_id, id, name

I reach the error in my django project when I was trying to display my view. The problem seems like related to the Course model but i honestly dont know where t

drf_yasg.generators: path component of api base URL http://localhost:8080/ is ignored; use FORCE_SCRIPT_NAME instead

I am using swagger (drf_yasg.generators) with Django and I get the following error message Error message is drf_yasg.generators: path component of api base UR

Django Rest-Framework search-fields wont work inside @action

I'm trying to use the search field offered by DRF inside of an action, but it seems to not work. I had a similar problem paginating inside of the action but fou