Category "django"

NameError: name '_mysql' is not defined - Django tailwind

When I run python manage.py runserver, my django server runs and I can see my webpage, however some of the tailwind doesn't work. When I then stop that server a

How to setup frontail with Django and Docker

I am trying to setup Frontail to access the logs for a Django application deployed using Docker locally. Has anyone done this before? There is very little docum

Can't get the Profile instance that have logged user as field

So i have here a 'create_project' view where l’m trying to assigne to the 'owner' field of project instance created a 'profile of the current user logged

Python list overwritten each time the previous items

The objective of my application is to create a copy of documents and insert them into the database for each annotator, for example, let's say the master user ha

How I can connect each name in list using id concept (python)

I created a list of users page and user profile page and I want when click on any name in the list it should show that user profile page. in .html <table cla

routes to manage groups and permissions with rest api endpoints in django

What is the best way to manage groups and permissions with django-rest-framework API endpoints? I want to have all functionalities that admin panel has to manag

Can't login into admin URL on production with Django 4

Can't seem to login into Django admin URL on my production but it works fine on my local. For context, currently my site does not have SSL. Debug is set to Fal

Interface for DjangoFilterConnectionField

I have two classes class RegisteredUser(graphene.ObjectType): class Meta: interfaces = (BaseClient, ) name = graphene.String() group = graphen

got a vertical scroll bar after adding ckeditor in Django

before adding ckeditor my webpage was working fine but when I add ckeditor to my textarea field I got a vertical scroll bar. my problem is I want to remove that

Decorator @property on ASP net core like in django

The thing is that like in Django which you can add model properties without changing the model class using the @property decorator. I'm trying to achieve same w

initial value of field modelform_factory in Django

This is my first post on StackOverflow. I'm also new to using Django (I'm actually using version 3.2). I have read about how to set the initial value of a field

Django high memory usage

I'm using django as a backend for a React frontend, and deploying both applications on Heroku. I also use Gunicorn do serve the application and signed the Hobby

I modify response.data in Django REST Framework view.py. Why am I getting an AttributeError during testing but not with actual API use?

My Django REST Framework API is working just as expected. In view.py, I modify OrderViewSet, def partial_update, to add another key/value pair to the response.d

KeyError at /webhook/ 'HTTP_STRIPE_SIGNATURE'

Following is my code for webhook with a Django application @csrf_exempt def webhook(request): webhook_secret = STRIPE_WEBHOOK_SECRET payload = request.b

How to count a single field of a django queryset with multiple group by?

Let's say I have a queryset qs. I'm grouping by the queryset as follows: ( qs.annotate( catering_price_enabled=F("outlet__library__settings__sligro_

Best approach to implement server-side caching on a Django GraphQL API?

I have an Angular frontend that uses Apollo Graphql client to interface with a Django Graphql backend (using graphene). It all works well, but the API is very s

Change Header Key for rest_framework's TokenAuthorization

By default, rest_framework's TokenAuthentication uses the "Authorization" key in the header, and looks for the keyword "Token" when authenticating requests. Aut

I can't run websocket django in server nginx

nginx map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 80; server_name www.abo3aly.com abo3aly.com;

How to search via Enums Django

I'm trying to a write a search function for table reserving from a restaurant, I have a restaurant model: class Restaurant(models.Model): """ Table Rest

Django Queryset annotate based on unique value

I am trying to write a queryset operation that transforms the first table into the second table as efficiently as possible This is the criteria: For each name,