Category "django"

CSS not loading properly when html element appended using jquery in django template

I'm working on an ecommerce app where trying to get products using ajax and append the product list using .append method and data is being appended the problem

Why the html custom form is not working django

I have a contact page with a simple form. Here is views.py: def contact_view(request): if request.method == 'GET': form = ContactForm() else: form = Con

Django unable to serve static files from s3 bucket

I created a few models and pushed my project to a development server on an AWS EC2 instance. I used Django storages and followed the docs to configure my settin

Rendering database data to browser in Django

I am having difficulties with showing database data in browser with Django. I have, for show my issue, just one date in my database. When I go to the Django She

Django: How to return an inline formset with errors

I have created a form to sign up a user by having them create a User object and a UserProfile object as follows: class UserCreationForm(UserCreationForm): c

How to have multiple one to one relations to a specific model

I have a scientific info model that has a one-to-one relationship to my User model. this is my model: class ScientificInfo(models.Model): id = models.AutoFi

How to delete multiple records from different classes in django?

It seems that whenever I run it and delete records I get server error (500) but it deletes the the data of class Bscs1_1 but for the rest of the classes it does

Error while loading the pytest module in Django project

I am trying to run pytest in a django project with it is showing me error of no module loading. I have created init.py in test folders, but that also not worked

Django forms.Form reflecting property field constraints

I'm implementing a Django Form witch should contain the field 'fieldA' from modelA: class ModelA(models.Model): fieldA = models.CharField(max_length=8)

how to create a employee multiple Experince in django

How to Create Multiple Experinces in Django This is Model.py Files code from django.db import models # Create your models here. class Detail(models.Model):

How can I use Q objects on Two Dynamic Search Forms in Django

I am working on a Django project where I want to search profile records for those that are resident in a particular country and state. In this project I would b

Django & Djoser 'NoneType' object has no attribute 'lower' 'NoneType' object has no attribute 'lower'

I keep having an error whenever I try to PATCH in order to update a specific user info. As per Djoser documentation, the endpoint is located in /users/me/ https

How do I display a Django form correctly using ListView

I am writing a simple app to track sales leads based on the Django tutorial "Writing your first Django app" (https://docs.djangoproject.com/en/4.0/intro/tutoria

How to include Bearer Token in Header using Django Rest Framework?

I'm using rest_framework_simplejwt package for JWT authentication in Django. I created some APIs for login, reg, token_verify, referesh_token and student_data.

Understanding pytest-django test arguments

What are 'rf' and 'user_context' parameters and when are they assigned? import pytest from rest_framework import status from rest_framework.reverse import rever

DRF how to update, create OneToOneField in serializers?

I have two models, with OnetoOne field. How can I update/create them with help of serializers? class Page(models.Model): info = models.TextField(null=True, bla

Django customUser models

I have faced two or three issues with django customuser model. The first one being the skills models. I wanted to add the Skills in the custom user, realized th

Two HTML Forms in one DJango views

I have two simple HTML forms on one page. I want to create Django view to submit multiple Django forms. I can submit form1 but I have no clue how to submit form

Rotate native iPhone images based on EXIF info?

Working on a site where users can upload photos. As many of you many know, unedited iPhone photos use an "Orientation" EXIF tag to determine orientation. On my

from django.core.management import execute_from_command_line not working

I am working on a bug project. Which is on Python 2.7, we are migrating to Python 3.9. I am getting import errors in manage.py during importfrom django.core.man