Category "django"

digital ocean deployment error: 502 Bad Gateway

I had my site up and running, but the admin CSS was not loading, I am not sure what I did that the server did not agree, but now the entire site is down with a

I keep getting RelatedObjectDoesNotExist at /admin/login/. How do I successfully create user profiles in Django via a one to one relationship?

I'm trying to extend the built-in user and add some more information to it. I have two apps in my django project- general and user_details. Inside my user_detai

integrating clean architecture with ORM

I'm trying to develop a monolithic Django application with Uncle Bob's clean architecture. The problem is I don't want to miss the powerful abilities of Django

Access "Browser" location

We all have seen this prompt: As far as I know, this is not IP-based location. This is device-based location. I don't want IP-based location because 1) It's no

how to access django related field from model methods?

is it possible to access django related field from model methods? for example, i have an Author with many Books is it possible to access the list of books fr

filefield serializer is not parsing the file object

I have a model in my application: class GRNRFIDSerials(models.Model): grn = models.ForeignKey(Grn, on_delete=models.CASCADE) file = models.FileField(up

Invalid block tag : 'endblock'. Did you forget to register or load this tag?

l get stuck in this error. l'm fresh user of Django and l m learning it by following steps on Youtube channel. l did everything same but l got this block tag er

How to check if a request consists of session id and csref token in the cookie in Django rest framework?

my rest_framework authentication and permission classes "DEFAULT_PERMISSION_CLASSES": [ "rest_framework.permissions.IsAuthenticated", "rest_fra

Django ValueError for deleted fields when running migrations

My models.py file is as follows: from django.db import models from django.utils import timezone from random import randint # Create your models here. class Fil

insert or update on table "django_admin_log" violates foreign key constraint

Trying to save a post on a django project I got this error The above exception (insert or update on table "django_admin_log" violates foreign key constraint "dj

how to use django post_save signal

I have two models, client and contact model with foreign key relation, I using Django signals to create contact while the creation of the client, but I getting

Cannot import ASGI_APPLICATION module while runserver using channels 2

I have followed the channels tutorial but while running these error throw Version of the packages is channels==2.1.2 Django==2.0.4 what I missed ? in settings

Using django-cas-ng to authenticate on admin site

I'm using django-cas-ng framework to authenticate users. The main problem is that the admin page still uses the default login view. Methods used this far: 1.-

Nested Category In django

how do I use nested categories in django as Im nwe to django and doing this and find some solutions but didnt work anything class MainCategory(models.Model)

In order to allow non-dict objects to be serialized set the safe parameter to False

I create realtime chat application using websocket frontend(angular) backend(Django).. i want to store messages in to db(mySql)..when i trying to store message

Django: Renaming Models, M2M Table not renamed

TLDR: Models moved to a new app. After migrating M2M relation refers to table that does not exist. Previous M2M table was not renamed. Django Version: 3.2.3 Sce

Looking in links: /usr/share/pip-wheels

I was using a virtualenv in Pythonanywhere and now after cloning my repo I tried to install all the packages by using this command pip install -r packageName/r

How can i exit the python shell to the terminal in Pycharm?

For example, I wrote the code; SyntaxError: invalid syntax >>> python manage.py command File "<console>", line 1 python manage.py command* t

How to pass a queryset from django to javascript function?

I want to pass a queryset from a view to a javascript function throught the template: my view.py: def myview(request): lista=Mymodel.objects.filter(ti

How can I Generate 10 Unique digits in Model Form and Pass Form Context Variable in Django Class Based ListView

I am new to Django Class Based Views and I am working on a project where on the template I want to have Form for creating customer accounts on the left and list