Category "django"

How to Print celery worker details on windows and mac

I actually had issues printing mine on command prompt because I was using the wrong command but I found a link to a project which I forked Project (If on Mac )

Images disappears from django web app deployed to heroku

I am working on a django project, writing rest APIs with django rest framework to use them in android application, my main idea is develop back end in django an

How to hide the Token model from rest_framework.authtoken in django admin panel

I tried to solve the problem using this two methods from rest_framework.authtoken.models import Token admin.site.unregister(Token) ----- from rest_framework.aut

Ho to create serializer for model having foreign keys to access that foreign keys tables data also?

I want to rewrite the following API in a more efficient way using the serializer. In the following API, the user and group are foreign keys. I want to return al

Django admin and normal user seperation

Everytime i logout of the normal user system it also logs me out of admin page. the normal user system is created using the AbstractUserModel provided by django

Error when creating a django superuser with Heroku - FileNotFoundError

I'm trying to deploy a django application on Heroku, but when it comes to the part where I need to create a superuser, I get an error: Traceback (most recent ca

Getting objects before validating data Django REST

I have to create a new Chat object using this view: class ChatListCreateView(ListCreateAPIView): permission_classes = [IsAuthenticated] serializer_class

Am trying to launch in Cpanel, but am getting a Module not found error

enter image description hereI'm new to Cpanel and am trying to launch my python Django project, I think I've set up everything correctly but am getting this err

How to return custom JSON response in DRF?

I have created API for News model: models.py class News(models.Model): title = models.CharField(max_length=255) created_at = models.DateTimeField(auto_n

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