Category "django"

Django: how to count posts related to a category in django?

i have a model class Category and also a model class Course. i want to count all the courses that are related to a model e.g: Web Devlopment - 26 Courses i dont

Indexing 80 million documents to elasticsearch from Django

I am using the latest version of django elasticsearch dsl and I am using the following command to index around 80 million documents: python manage.py search_ind

Stuck at Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

Upgraded pip command still having this message. I am trying to install django-allauth. The following error is generated while using pip install django-allauth (

why does my django site url reveal the directory path on the server?

I am deploying a django site for the first time to a cpanel server with phusion passenger on cloudlinux and i have discovered a weird phenomenon that can't be n

django-import-export error while importing data into database

Here's the SS of import error And this is the SS of CSV file Line number: 1 - 'id' Traceback (most recent call last): File "/home/carlmark/Desktop

Django WebSocket DISCONNECT /ws/chat/lobby/ [127.0.0.1:3022]

i want to create chat app, i follow the https://channels.readthedocs.io/en/latest/tutorial/part_2.html here, chat/ __init__.py routing.py urls.py

How to get data that belongs to specific user in Django Rest Framework?

I haved Format_List model with relation with Django user and now I want to get the data belongs to specific user by giving user id or after user login. models.p

Why does Django use `Meta` inner class in models?

If I want to describe some information such as ordering, if the model is proxy or abstract, which fields must be unique together, then I need to put this inform

Django Rest Framework gives 302 in Unit tests when force_login() on detail view?

I'm using Django Rest Framework to serve an API. I've got a couple tests which work great. To do a post the user needs to be logged in and I also do some checks

Need help setting value for "is_staff" and "is_superuser" for Django LDAP authenticated users

I new to both Django and LDAP. I am creating a Django application with LDAP authentication as the login system. I am able to connect to the LDAP server and auth

Django - Hide labels in inline

How to hide labels in Django inlines?

why does for loop not working in django template

this is my views : rooms = [ {'id': 1, 'name': 'room-1'}, {'id': 2, 'name': 'room-2'}, {'id': 3, 'name': 'room-3'}, {'id': 4, 'name': 'room-4'},

How can to get data from related model in Django Rest Framework?

I have next models class User(AbstractUser): ip_address = models.CharField(max_length=15) class Statistic(models.Model): user = models.ForeignKey(User

Queryset is Containing some items but all() method returns empty array

I have this code: print(f"DEBUG 1: {queryset}") transaction_items = queryset.all() queryset.update(status=TRANSACTION_STATUS_COMPLETED, processing_method=PROCES

Django Unable to login

Login and Log out is only working for admin panel , not for user panel , after loging in from user end , its not getting reflected in the home screen . The defa

Advise on orm modelling in django

I am building a webapp in which users place orders with nested information. I am after some advice on best practice so I can do some more research. The idea is

Django manage.py runserver graceful reloading

I am working on a Django project, which integrates a webcam and OpenCV. For the webcam access, I use following code. The webcam can be released if I use Ctrl +

How to set Authorization header in Django?

I want to set the bearer token in the authorization header. why? Because I am using rest_framework_simplejwt in my Django project. I want to implement authoriza

Django throws AttributeError: 'str' object has no attribute '_meta' when I register my Model

Im novice and I didnt find solution for this problem. Im writing code for a blog. I have a model Post where I want to create field author which is ForeighKey to

css and other assets not loading for my django webapp

CSS, JS, fonts, images and other assets are not being loaded into my django app index.html. All the assets for the app are present inside the application app in