Category "django"

How to solve PytestConfigWarning: Unknown config option: DJANGO_ SETTINGS_MODULE error?

I am using django to build my website and I have used django-pytest to test my apps but I have got this error Note I am usign python 3.9 =======================

How do I Concatenate or Combine the dictionary of same data to One

I have the below set of 7 Dictionaries {'empid':785, 'empname':'Ibrahim', 'date(2022,5,1)':'Unmarked'} {'empid':785, 'empname':'Ibrahim', 'date(2022,5,2)':'Unma

How to prevent django admin login and logout sessions from reflecting in actual website?

I'm quite new to django. I've made a website that makes use of user auth for login, logout and registration. Whenever I log into the admin panel, it also gets r

Best way to pass random answers in Django Quiz App

I'm trying to build quiz app based on Cornell Notes, where the keywords will be the question with 4 answers (one correct answer and three random from other keys

How to change add another[object] behavior in TabularInline

I want to make an admin InlineTabular add another object button and take me to the object add page with prepopulated fields instead of creating an inline model

i am not get linkedin profile picture url in extra data using django allauth linkedin login

i can't get linkedin profile image in extra data when login using django-allauth. in extra data, profile picture url does't exist. i am using django==4.0.4, dja

django create a field that hold array of tupels or array of array

I want to add a field in my models that hold value like this field = [(1,2,3),(6,5,4),(5,6,7)] or field = [[1,2,3],[6,5,4],[5,6,7]] I am using po

Import issue in Djoser- Django

I'm trying to build an user authentication system with React and Django. I'm using JWT, Djoser for authentication model. serializers.py: from djoser.serializers

drf - trailing / in url throwing error while calling post api

views.py class FurnitureViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, GenericViewSet): permission_classes = [AllowAny] serializer_class = Fu

Using metamask to authenticate a SSO flow

Is it possible to do something like a social signup/login using crypto wallets like Metamask? Analogous to signup/login with Google/Facebook/Apple... Does the c

Django rest framework using Template to send an e-mail

I want to send a styled email using HTML tags. The mail is sent successfully but without style and the HTML tags are presented as a text in the email. handles.p

What Causes 400 Bad Request In Django Graphene and NextJs Using The useMutation Hook?

I am trying to build a simple todo app using Django, Graphene and NextJs. I was able to create todos in graphiQL and postman, however when I try to create a tod

drf - remove miliseconds from serializers.DateTimeField when sending response

I have to write a serializer that returns datetime in the following formats: 2012-01-01T13:00:00+00:00 (utc_with_timezone) 2020-01-01T09:00:00 (must be in local

django django-yearmonth-widget display month as month name

I have used package "django-yearmonth-widget" to have year and month selection and not complete date. Here, day is fixed i.e. 1st of every month. This implement

Django- Can only concatenate str (not "ManyRelatedManager") to str

I am trying to save my model. But when I try to save my model I throws the following error TypeError at /admin/user/teacher/add/ can only concatenate str (not "

how to display models.full_clean() ValidationError in django admin?

https://docs.djangoproject.com/en/4.0/ref/models/instances/#validating-objects from django.core.exceptions import ValidationError try: article.full_clean()

Group base permission rest api in Django

i am using Django rest framework for my login api. Now i want to login only certain group user through api. I have created group and assigned user to the group.

Django PDF parser on POST request

I hope for your help. Because I have been struggling with this problem for a long time. A POST request comes from the frontend with one PDF file, after which I

Need to override save method for image field and save it as base64 string using django

models.py class Organisation(models.Model): org_id = models.CharField(max_length=50,default=uuid.uuid4, editable=False, unique=True, primary_key=True)

python module installation error when deploying a Django application on heroku

I am deploying my django application on heroku. but when installing the modules from the requirement.txt file, it returns an error on the "Paydunya" module. I a