Category "django"

Django DEBUG=False won't upload files to STATIC_ROOT

I'm trying to give the user the ability to upload images on a website I created with Django and the images are uploaded fine when running with DEBIG=True but th

ValueError: Missing staticfiles manifest entry for 'favicon.ico'

I'm getting a ValueError when running python manage.py test. My project is named fellow_go, and I'm currently working on an App called pickup. Please note that

Limit Django users to one single group

I'm rather surprised that this hasn't been asked before, but I need to limit my Users in Django to only belong to one single Group. How would I do this?

django.db.utils.IntegrityError: UNIQUE constraint failed: rango_category__new.slug

I'm learning Django from Tango with Django but I keep getting this error when I type: python manage.py makemigrations rango python manage.py migrate This is

Can't import rest_framework in Django

I'm trying to stand up a Django site and I am attempting to setup Report_builder with that. I just got the front end of report builder to work but it is not ret

Error when deploying django web application with daphne: Requested setting INSTALLED_APPS, but settings are not configured

I have been battling with an error that I encountered when trying to deploy a django application that uses channels. Error in heroku logs Starting process with

I can't distinguish roles with my implementation in DRF+Angular

I've made an implementation of a login system using django as backend and angular as frontend. In the backend the authentication is implemented via the view ass

Python(Django) :I want the payment form(code) triggered whenever a user clicks the submit button and only saved into DB if payment is succesful

I am currently using DJANGO How can I make the payment form(code) triggered when a user clickn submit and also make it saved into DB after successful payment. P

Django query for latest version of a object

I am trying to write a query in Django but I'm not sure whats the best way to write this. Also assuming that the database is mySQL. This matters if distinct i

How to deal with model changes in Django Rest Framework?

This is not a question for a particular use case, but for something I noticed in my experience doing APIs, specifically with using Django and Django Rest Framew

Merge Date Time in Django ORM

I was trying to combine date and time. For that i was using datetime.combine. But it is giving AttributeError module 'datetime' has no attribute 'combine' Time

last_login field is not updated when authenticating using Tokenauthentication in Django Rest Framework

I'm working in a project which relies in a Django User model and TokenAuthentication under DjangoRestFramework I was requested to get last login datetime for e

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