Category "django"

Django Rest Framework Postman Token Authentication

I am using Django Rest Framework Token authentication and if i do curl http://localhost:8000/api/v1/users/?format=json -H 'Authorization: Token 0a813fdcd3f8846d

how to pass post parameter in Django rest swagger?

I have integrated swagger with django rest framework, but the swagger docs does not create a input box to post data for post request. I am using Function based

how to set up postgres database with pytest-django?

I would like pytest-django to install a Postgres extension when it creates a test database. I've been mucking with conftest.py to try to get this to work, but

Django Form. View form with models of logged user

I'm doing simple to do app in django. I want user to have possibility to add boards and task (task is specified for board). When user is adding task (form creat

OperationalError, no such column. Django

I am very new to django and was able to finish the tutorial on djangoproject.com without any errors. I am now going through the Django REST framework tutorial f

Django change an existing field to foreign key

I used to have a model like this: class Car(models.Model): manufacturer_id = models.IntegerField() There is another model Manufacturer that the id field re

django static file not loading

I have problem that i done every thing as described in tutorial https://docs.djangoproject.com/en/1.5/intro/tutorial06/ and every thing also running fine but cs

"Local variable referenced before assignment" Django error

I have no idea what may cause this issue. The only change I've made was add the loginquiredmixins to my class-based views. Once I started stylising the login pa

Paramiko SSH failing with "Server '...' not found in known_hosts" when run on web server

I am trying to use Paramiko to make an SSH communication between 2 servers on a private network. The client server is a web server and the host server is going

Is it possible to modify Django Q() objects after construction?

Is it possible to modify Django Q() objects after construction? I create a Q() object like so: q = Q(foo=1) is it possible to later change q to be the same

Issues to fully delete a hash key in redis

i'm using Redis with Python and Django and i have some trouble with the delete of Redis. I create hash key to store multiple informations about a vehicule, but

Problems to send email using Django EmailBackend

I don´t know what is wrong in my code. I´m trying to use send_mail using django.core.mail.backends.smtp.EmailBackend but is not working. The securit

Can I build my form without using Django form?

I'm using Django and I just did a big form Using HTML5 and bootstrap. Can I still send the form via the post method to django if I'm not using it to generate th

Unable To Install Simple JWT in my Django Project

Here's my setup right now: Pip Freeze: asgiref==3.3.1 Django==3.0 djangorestframework==3.10.0 djangorestframework-simplejwt==4.6.0 PyJWT==2.0.1 pytz==2021.1 sql

Add field to AbstractUser admin page

I have an AbstractUser class in models.py file in order to extend the django user default class, class Profile(AbstractUser): address = models.CharField('A

Create a save data using Django post_save() Signal

Here I want to create a heatmap when a Lead is created, it'll create an example api for the particular API. This is my lead model and another model for the api,

How to wrap text in Django admin(set column width)

I have a model Item class Item(models.Model): id = models.IntegerField(primary_key=True) title = models.CharField(max_length=140, blank=True) descr

Django REST Framework ModelSerializer get_or_create functionality

When I try to deserialize some data into an object, if I include a field that is unique and give it a value that is already assigned to an object in the databas

Redirect is not allowed for a preflight request

I have this problem where i get the response when trying to use a rest api: "Access to fetch at 'https://kollektivet.app:8082/api/login/' from origin 'https://k

Django model validator not working on create

I have model with a field validator from django.db import models from django.core.validators import MinValueValidator, MaxValueValidator class MyModel(model.