Category "django"

Creating and displaying pyvis graph from django app running sql backend

This is moreso a question about pyvis graphs, but also involves a django server running with a sqlite3 backend. One of my views needs to produce an interactive

What is the correct way to implement Django password history?

I have implemented a solution for checking a new password against the last 5 passwords like so: Created 5 fields in a user profile table to store the encrypted

Django model self-reference: prevent referencing to itself

I have the following model: class Category(models.Model): name = models.CharField(max_length=255) parent = models.ForeignKey('self', related_name='chil

How to return an rest_framework.response object from a django custom middleware class?

I am trying to write a middleware class that ensures that the user is logged in. But the problem is this middleware class will only be applicable to a small set

[Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.9.so.1.1'

When I run $ python manage.py inspectdb --database=mssql_database I have the following error django.db.utils.Error: ('01000', "[01000] [unixODBC][Driver Manager

Case sensitive search in Django, but ignored in Mysql

I have a field in a Django Model for storing a unique (hash) value. Turns out that the database (MySQL/inno) doesn't do a case sensitive search on this type (VA

postgresql: FATAL: password authentication failed for user "douglas"

I am trying to migrate a DB from sqlite to postgresql...so I typed: sudo -u postgres psql postgres=# ALTER USER postgres WITH PASSWORD 'newpassword'; and the

How to logout in django?

html code {% if request.user %} <a href="{% url 'main:logout' %}"> Выход </a> {% else %} <a hr

[django]when debug=false,MEDIA_URL returns not found

when DEBUG=TRUE,media_url is working,but DEBUG = False ,returns not working. This is my setting file. setting.py DEBUG = False ... MEDIA_URL = "/pics/" MEDIA_

NoReverseMatch at / 'learning_logs' is not a registered namespace

I think i tired everything in trying to solve this problem. I'm getting a NoReverseMatch i understand its from my "urls" but that's basically it, I was using ur

django permissions: new permission is inserted after all other migrations

I added a new permission to my model, and than used manage.py makemigrations. it created a migration that alters the model options (specificly the permisions..)

Cors problem with nginx/django from react app on docker

I have a question about cors implementation in django. Having a problem with setting the correct cors values. My deployment is on docker. I have a deployed 3 co

How to set environment variables in PyCharm?

I have started to work on a Django project, and I would like to set some environment variables without setting them manually or having a bash file to source. I

Run multiple django project with nginx and gunicorn

I am using Ubuntu 18 servers and using nginx with gunicorn I follow Digitalocean tutorial for server setup. I successfully did for one project but now I need to

Google Authenticaon in Django and React

Using django-allauth I've enabled google authentication on backend. I can sign in to my Django project and everything. Now, I want to connect that authenticatio

Bulk save edited items with Django?

I am editing a large number of model instances in django and I would like to save all these changes at once. The instances are already created so I am not looki

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