Category "django"

Not Implemented Error in Django Channels Layers

I was following the Django channels tutorial to create a simple chat application. But while trying to check if the channel layer can connect to Redis, I get thi

django removes "is_staff" permission if I try to login

I have a pretty strange situation within my django project. I have a LoginForm where a user can log into the website. I am using django 3.2.12 with some other l

Extra operation button in django admin panel

I want to add some buttons to do a lot of database operations at once, and I want to place those button(s) at (1) place. How to do that? Extra explains: What I

Implementing a search query inside a filter

I've been trying to implement a search bar inside my application, but I don't know how to query for similar names inside my db. Here is my view.py queryprms

Debug Toolbar not showing

I installed: pip install django-debug-toolbar I have DEBUG=True in my settings I have django.contrib.staticfiles and debug_toolbar in INSTALLED_APPS i have STAT

Graph not being displayed on django framework

I want to display a graph using C3 Javascript library which displays future prices of textile raw materials on django framework. When I run the code it does not

Flask Unique SQLAlchemy with Flask-LImiter

I want to make a project with flask where you sign up and sign in and then you can make new posts. I use flask-limiter to prevent users from making new posts. A

Upload file from html when block public access is true

I am using django-s3direct to file upload https://github.com/bradleyg/django-s3direct Using IAM role setting because I upload the file from the server on ECS co

Filtering in Django which depends on first field

Suppose I have 3 fields of a Car Shop. those are Condition, Brand, Model . class Car(models.Model): ConditionType=(('1','New'),('2','Used'),('3','Reco

Django Form processing files

So I have the following code: # the view class UpdateDateView(LoginRequiredMixin, UpdateView): model = Date form_class = DateForm template_name = '

Test a decorated function in Python

I have a Python function which is decorated. @retry_if_access_token_expired(app_id) def add_something( self, *, argument1,

Add Django Rest Framework Login Button to Browsable API when Using Third Party Auth Library (django-rest-knox)

The login button is missing from my browsable API. I am using django-rest-knox for token authentication. My urls.py contains: urlpatterns = [ path('admin/',

How to implement only client to graphql subscriptions in a website with only front code?

I am coding a only front end site using Django. to query data to a DataBase I use AJAX to my Django and Django requests a third party GraphQL. so far all works

Getting Bad Gateway and Connection reset by peer using asyncio + aiohttp

Is there some async expert with sharp eyes around? I am using asyncio (Python 3.9) with aiohttp (v3.8.1) to fetch multiple urls asynchronously through a proxy,

mock queryset in Django unittest

I have sample code and test: def outer(): inner_response = inner(param1) def inner(something): queryset_response = something.object.filter(foo="bar",

Install Django on Gandi instance

I am trying to install an Django app on Gandi. For now, what I have is un file name wsgi.py: import sys import os import os.path sys.path.insert(0, os.path.abs

How to get the json key and value in Django's Templating language?

I'm trying to build a website for tv series using Django framework, I put in the models.py all kinds of details about that show and a JSONField to define the nu

Fixing django inspectdb after importing postgresql sample database

Context: I'm playing around with setting up a DRF project using the postgresql sample database located here: Postresql Sample DB Problem: The sample database is

How to use multiple databases in Django with an empty 'default'?

I'm trying to make a multiple database project in Django. But I'm having problems to properly migrate my models to the appropriate database. I'm using the 'Writ

makemigrations - No changes detected -Django

I am new to Django, and im trying to create a company profile for user to fill up. when i make migrations, i got the following error which is no changes detect.