Category "django"

DRF Error: Cannot assign must be a instance

I'm working on an app that lets you track your expenses and I'm trying to create an 'balnace' object when the user registers, but when I try so I get an Error:

Can't call / pass data from django database onto website using built in auth model and a model I created, which is the one I cant query

Any help would be appreciated, basically I am a beginner and I'm struggling to pull data from my database. I used the built in auth method from django, which s

error: Unable to find trailer dictionary while recovering damaged file

PyPDF2 fail sometimes with decryption of some PDF files, and I am trying do decrypt them with pikepdf but I am getting this error: Unable to find trailer dictio

Django Exception: 'TemplateDoesNotExist at /'

I'm new to Django and trying to convert a HTML template to Django project. This is my directory structure: . └── MyProject ├─&

positional argument error in sheduling task in python

I got a positional argument error when i tried running my code and the do() passes extra arguments to the job function import schedule from schedule import Sche

HTMX, Django - update part of page

I've started with HTMX and I want to use it to refresh part o page after pressing button on pop-up page. The button is adding clicking user as participant in an

User account delete in django's rest

I want create view which can deactivation user's account. when i create view and send delete request i have error - > "detail": "You do not have permission t

Required parameter name not set - Django + Amazon S3

I'm trying to setup Amazon S3 for my Django app and I keep getting told 'Required parameter name not set '. This error seems to happen when an image needs to be

Create a decorator that will check if the function will run successfully or throws error?

I have to create a decorator for a event in django and store all args, kwargs, status, etc in django model. So far I am able to store args, kwargs and traceback

Django: ImportError: No module named doc

here is the traceback System check identified 1 issue (0 silenced). September 10, 2018 - 13:01:31 Django version 1.8, using settings 'settings' Starting devel

Navbar fixed left - Bootstrap

I am trying to make navbar in bootstrap to be fixed left, like on this link. Anyway, it is working, but when I add block content of the leaflet map, my navbar i

Save multiple objects serializers only if both of them are valid

I have multiple serializers objects that comes from the request as json file. I want to store them inside databases only if they are Valid (all of them must be

Local Variable 'X' Referenced Before Assignment in Django Views

I am working with Django and trying to create two forms on one page which I am struggling with. I would like to know why I am getting the error "local variable

django get the value enside formvalid

I am trying to obtain the value of the val variable that is inside form_valid but I cannot obtain it. Does anyone have any idea what I'm doing wrong? class Coti

Django cannot import login from django.contrib.auth.views

I try to build a login function for my page. To edit the urls.py as followed, it keeps printing this: cannot import name 'login' from 'django.contrib.auth.view

Django. How to save serialized and validated data?

I have a Car model with name, model and serial number fields. In which the combination of the name and model fields must be unique. I am using serializers.Model

How to filter in a table column contains list in django

I have a table column A=['1','2','3'] and I want filter from the table if the filter value is exist in the list. eg: id='1' Models.objects.filter(A=id)

Python QuickBooks API

I have a problem working with python-quickbooks package, I try to follow the docs: https://pypi.org/project/python-quickbooks/ Here is my code: from django.co

django annotate whether exists or not

I have a query I'm using: people = Person.objects.all().annotate(num_pets=Count('pets')) for p in people: print(p.name, p.num_pets == 0) (Pet is ManyToO

Error "Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?" in postgresql on docer

I have Django application with postgresql on docker. I tried to insert data like this: import psycopg2 try: connection = psycopg2.connect(user="postgres",