Category "django"

Got Error while installing mysqlclient in django project on cPanel

Requirements.txt contains: asgiref==3.4.1 Django==3.2.9 django-isbn-field==0.5.3 mysql-connector-python mysqlclient phonenumberslite==8.12.42 Pillow==9.0.1 pyth

Why isn't Django Sitemap showing the URLs

I've been trying to make my django sitemaps work for a small blog application. After checking out multiple tutorials, I still can't get the sitemaps work proper

How to render user profile (actual image) instead of filename in a Django form which basically update user-account

I am following a Django course on youtube, and I need a small change in my Django form. The form looks like: Rendering the form fields in 'edit-user.html' temp

How to Give List of Objects IDs and add a click event based on each List IDs in Django

Here in my Django code, I have a list of prices. Now I gave them unique IDs which works well, but when I try to add a click event, the click event only works fo

ImportError: cannot import name '...' from partially initialized module '...' (most likely due to a circular import)

I'm upgrading an application from Django 1.11.25 (Python 2.6) to Django 3.1.3 (Python 3.8.5) and, when I run manage.py makemigrations, I receive this messasge:

Django says that model has no ForeignKey to another model but it really does

Will you help me to figure out why Django raises this error? SolutionsForLanguagesApp.LanguageLevel: (fields.E336) The model is used as an in termediate

ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects

The Heroku Build is returning this error when I'm trying to deploy a Django application for the past few days. The Django Code and File Structure are the same a

I am having issue with django web application deployment on ubuntu VPS. The issue is that the server do not give any response even on 0.0.0.0:8000

While deploying the Django website everything goes right but when I run the command python manage.py runserver 0.0.0.0:8000 then the server starts successfully

I would like to run for loop to each of li tag and want to add content dynamically from django backend admin

I have created a navbar and content can be added from the backend but only the home nav bar shows the icon and the other navbar name is with the same icon. I wa

How does "template.Library()" and "get_related_name" work in django?

I'm working on a basic social media django project with the help of an udemy course. The following are the models i created: group : models.py register

does filtering queryset in django query database every time?

Imagine I have the following code: qs = Users.objects.all() list = [] for i in range(10): list.append(qs.filter(age=i)) here the filter is called 10 times

Why do I get [INFO] Worker Exiting (pid: 2) when deploying cloud run service with docker? (On VSCode with cloud code extension)

I'm really new to this stuff, I'm a 16 year old currently doing a research project/internship, and I've just started 2 weeks ago. So I'm extremely confused. I'v

Configuring PostgreSQL schema for default Django DB working with PgBouncer connection pool

I need to set the default DB schema for a Django project, so that all tables of all apps (including 3rd party apps) store their tables in the configured Postgre

Why are the error reporting emails not being sent (Django)?

Python version: 3.6.3 Django version: 3.0.8 I am trying to use enable Django's error reporting via email, but nothing seems to happen when I encounter a 500 err

How to print multiple object from table def __str__(self):return self.title

I created a article models below models.py class Article(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, blank=True) is_deleted

Django: how to count the ratings and reviews of a post using django?

i have a model course and i also have a model review and rating that allows users rate a particular course. now i want to count all the ratings on each course w

DRF-simple-JWT: New user registered but not able to login

I am able to create a New User using the "register" endpoint. I can the user being created on the admin page as well. When I try to get an access token for the

Detect when user register/Login on Context Proccessor Django

I have to do some checks all the time with the context proccessor.The value must be 'True' as soon as the user logs in.But when navigating the site after loggin

understanding try except python/django

I need your help with understanding try-except python/Django. so I have this function: def submit_dept_head_application(request, application_id): cv = request.F

How can we add more than 3 authors field for a single magzine? in Django models

I created a magzine model in django. But their are more than three authors of a magzine. I have written below code for three authors. If I write the code of two