Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
'WSGIRequest' object has no attribute 'htmx'
Hi just looking for some help at solving this error in Django whilst trying to call a view that to accept a htmx request. The final result is to display a popup Modal of images from a Gallery when a thumbnail is clicked. HTMX installed via script in head. View if request.htmx: slug = request.GET.get('slug') context = {'pictures': Media.objects.filter(slug=slug)} return render(request, 'main/gallery-detail.html', context=context) context = {'objects_list': Albums.objects.all()} return render(request, 'main/gallery.html', context=context) Relevant html with the button to open gallery of images. <a class="btn btn-primary" hx-post="{{ request.path }}?slug={{ img.slug }}" hx-target="#modal"> {{ img.slug }}</a> {% endfor %} <div id="modal">{% include "main/gallery-detail.html" %}</div> -
How do I run function on database class rather than class in views.py in django
I have this in my views.py, it all works if I use the class in the views.py but if i switch the function to use the same class in the models.py (which is what I want to use) I get: '<' not supported between instances of 'int' and 'DeferredAttribute' If I declare it an int() then I get: a typerror. int() argument must be a string, a bytes-like object or a number, not 'DeferredAttribute' This is my code. Can someone point me in the right direction please. from django.views.generic.base import TemplateView from django.shortcuts import render from django.http import HttpResponse import math, datetime from settings.models import Extruder class Extruders: def __init__(self, name, min_width = 0, max_width = 0, max_speed = 0, gussets = False, printer = False, location = "GY", lft = False, cfs = False, dws = False, jfs = False, sws = False, treatment = False): self.name = name self.min_width = min_width self.max_width = max_width self.max_speed = max_speed self.gussets = gussets self.printer = printer self.location = location self.lft = lft self.cfs = cfs self.dws = dws self.jfs = jfs self.sws = sws self.treatment = treatment def __str__(self): return self.name ext1 = Extruders(name = "Extruder 1", max_width = 300, min_width … -
How do I implement user authentication in Django using rest_framework?
I'm using Django/Python3 to make a simple API. I already made my models and views (also using serializers). Currently this is my login view: class LoginView(generics.CreateAPIView): queryset = User_Login.objects.all() serializer_class = LoginUserSerializer def post(self, request, *args, **kwargs): id = request.data['id'] name = request.data['name'] password = request.data['password'] email = request.data['email'] User_Login.objects.create(id=id, name=name, password=password, email=email) return HttpResponse({'message': 'User Created', 'id': id}, status=200) All my views are basic like this, just to implement a database that I previously modeled. I need to implement authentication (the one that generates simple tokens that the user need to add to their request's header) and I know It's easy, but I followed this tutorial and I got a lot of errors. Any advice? -
Django: "Cannot resolve keyword 'email' into field. Choices are: created_at, expires_at, id, otp, user, user_id"
I'm trying to validate an OTP that was sent to the user when registering i have a separate model for otp which has an OneToOne relation with the user Otp Model class Verify(models.Model): user = models.ForeignKey( User, on_delete=models.CASCADE, related_name="userverify", blank=False, null=True) otp = IntegerRangeField( min_value=111111, max_value=999999, blank=True, null=True) created_at = models.DateTimeField( _("created at"), auto_now=False, auto_now_add=True, blank=False) expires_at = models.TimeField(null=True) the Verify_Email view takes an email and otp value to validate the email How I'm trying to verify the otp class Verify_Email(APIView): def post(self, request): try: data = request.data serializer = VerifySerializerBase(data=data) if serializer.is_valid(): email = serializer.data['email'] otp = serializer.data['otp'] verify = Verify.objects.filter(email=email, otp=otp) user = User.objects.filter(email=email) if not user[0].exists(): return Response({ 'message': "A user with this email was not found" }, status=status.HTTP_400_BAD_REQUEST) elif user[0].is_active: return Response({ 'message': "This email has already been verified" }, status=status.HTTP_400_BAD_REQUEST) elif verify[0].exists(): if verify[0].expires_at >= datetime.now(): return Response({ 'message': "This OTP has expired, please request another one" }, status=status.HTTP_400_BAD_REQUEST) elif verify[0].otp != otp: return Response({ 'message': "This OTP is invalid" }, status=status.HTTP_400_BAD_REQUEST) else: verify[0].delete() user[0].is_active = True user[0].save() return Response({ 'message': "Email has been verified" }, status=status.HTTP_200_OK) return Response({ 'message': "Something is wrong" }, status=status.HTTP_400_BAD_REQUEST) return Response({ 'message': "Something is wrong" }, status=status.HTTP_400_BAD_REQUEST) except Exception … -
Combine Scrapy with Django or isolate them
I have a Django application running at AWS ,I want to have a Scrapy crawler program to fetch data and insert into the Django application database. Now I have 2 options ,either combine Scrapy with Django or build a isolated Scrapy project and directly insert data into data without through Django's Model. I'm wondering which option is better ,I personal prefer isolating these 2 projects.There are 2 reasons: 1.I have no experience to combine Scrapy with Django. 2.Lower the risk, if one die another one can still alive. Any suggestion? -
How to change 2 separate parts in an HTML without Refreshing page using Ajax in a Django Project
I have a HTML template for a django project where there are 2 button on the top of a page and one at the end of the page. In the begining the top button is enabled and the lower one is disabled. My objectiveis that when a user clicks on the top button it gets disabled and the lower button gets enabled. Currently I am at the stage that when a user clicks the top buttons gets disabled with the whole page refreshing but I want to add the lower one to it as well. Here is the main template to have a better idea: <!-- button --> <div id="startworkout"> {% include 'my_gym/button.html' %} </div> <!-- button --> ................................................... <!-- button --> <div id="deactivate"> {% include 'my_gym/deactivate.html' %} </div> <!-- button --> Here is the button.html: <form action="{% url 'my_gym:bla' id=workout.id %}" method='post'> {% csrf_token %} {% if workout.active %} <button disabled id="customSwitches" type="button">Close Workout </button> {% else %} <button value="true" id="customSwitches" type="button" >Start the workout </button> {% endif %} </form> Here is the 2nd part deactivate.html of that I want to include: <div> {% if workout.active %} <button id="stop" onclick="stop();" type="button">Finish Workout</button> </a> {% else %} <button disabled id="stop" … -
How do I resize an image to be rendered in template without affecting original image?
I tried resizing the image in my views.py using PIL, but it doesn't take effect in the rendered page as the image is still the same size. Is there something obvious I'm missing? Views.py def home(request): if request.method == "POST": pass vendors = Vendor.objects.all() size = (360, 200) for vendor in vendors: try: image = Image.open(vendor.imageURL) except: continue image.thumbnail(size) image.save(vendor.imageURL) context = {'vendors': vendors} return render(request, 'home.html', context) Models.py class Vendor(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) name = models.CharField(max_length=200, unique=True) image = models.ImageField(null=True, blank=True) def __str__(self): return self.name @property def imageURL(self): try: url = self.image.url except: url = '' return url -
Vue - Accessing Attributes in a Django Dictionary
In Vue, using {{ game.data }} results in: [ { "game": 1, "turn": 1, "player": 1, "word": "trend", "score": 18 }, { "game": 1, "turn": 2, "player": 2, "word": "test", "score": 12 } ] But I want to access {{ game.data.player }} My models.py class Game(models.Model): date = models.DateTimeField(auto_now_add=True) def __str__(self): return str(self.id) class Word(models.Model): game = models.ForeignKey(Game, related_name='word', on_delete=models.CASCADE) turn = models.IntegerField() player = models.ForeignKey(User, on_delete=models.CASCADE) word = models.CharField(max_length=255) score = models.IntegerField() serializers.py class GameSerializer(serializers.ModelSerializer): data = serializers.SerializerMethodField(read_only=True) class Meta: model = Game fields = ['id', 'date' ,'data'] def get_data(self, obj): return WordSerializer(obj.word, many=True).data Game.vue <script> import axios from 'axios' export default { name: 'Game', data() { return { game: {}, } }, mounted() { this.getGame() }, methods: { async getGame() { this.$store.commit('setIsLoading', true) const GameID = this.$route.params.id axios .get(`/api/v1/games/${GameID}/`) .then(response => { this.game = response.data }) .catch(error => { console.log(error) }) this.$store.commit('setIsLoading', false) } } } </script> Thanks in advance, -
Can I Use Django's context processor in Django rest framework
I have a question I need to store some data globally so I can access them anywhere in my Djangorestframework application, kind of like how flask provides flask.g for this. Can I use Django context processor for this? I know I can use Django context processor if I am working with Django templates, I just want to know if it is possible for me to use it with Djangorestframework -
Show the values in dropdown in reverse order in Django Forms
class FineForm(forms.ModelForm): class Meta: model = Fine fields = ['student', 'fine'] widgets = { 'student': forms.Select(attrs={'class': 'form-control'}), 'fine': forms.TextInput(attrs={'class': 'form-control'}), } I have this Django form. The student field is a foreign key. I want to show the students in reverse order in this form in the template. Help please. -
Django, MySQL, and SSL certs: strings instead of filenames?
I'm attempting to configure a Django application to connect to a MySQLDB instance with TLS configured. Django's DATABASES settings documents how to configure the ssl settings, for eg.: DATABASES = { 'default': { 'ENGINE': os.environ.get('DATABASE_ENGINE', 'django.db.backends.mysql'), 'HOST': os.environ.get('DATABASE_HOST'), 'PASSWORD': get_vault_secret('DATABASE_PASSWORD'), ... 'OPTIONS': { 'ssl': { 'ca': '/ca/server.cert.pem', 'cert': '/ca/client.cert.pem', 'key': '/ca/client.key.pem' } } }, } Our problem is that the values required for ca, cert, and key are filenames. Our app is containerized, and we pull all of our secrets from hashicorp Vault during app initialization using a helper func (see the value for PASSWORD). We also store client certs, keys, etc in vault, and would like to supply these to Django directly - but MySQL demands a string, pointing to a file. Is there a way to wrap the cert / ca / key strings we get from vault into some kind of IOFile / BytesIO esque container to pass from Django, to python mysqlclient, to mysql_ssl_set()? Due to security considerations, actually writing these values to a file is not an option. -
after uploading file in the page update contents without refreshing the page using htmx (without ajax)
Hi iam new to HTMX and as well as Ajax and JQuery. here im not familiar with htmx and i have an issue with using htmx instead of ajax and Jquery. I have an drop down menu(options as the folder names) while selecting the option the files in the folder are displays as table there is an upload option will be enabled. using the upload option you can upload files after clicking the upload button the file is uploaded into that selected folder and displays in the same state. here, I need to show the uploaded file in that display files area without uploading the page(using htmx) and without using ajax & JQuery . how can proceed with this requirement. I have attached my html,python and JS codes here with the question.. Any help would be appreciated... script.js // Getting name of the uploaded file function fileInfo() { uploadFileName = document.getElementById('file').files[0].name; } function getDirectories() { let arrayOfThisRow = []; let inputFile = document.querySelector('input[type="file"]'); let uploadBtn = document.querySelector('input[type="submit"]'); inputFile.addEventListener("change", updateBtn); function updateBtn(e) { let tableTr = document.querySelectorAll("table#data tr"); for (let i = 0; i < tableTr.length; i++) { let tableData = tableTr[i]; let tableDataQuery = tableData.querySelector("td"); if (tableDataQuery) { arrayOfThisRow.push(tableDataQuery.textContent); } … -
half of the css styles don't work in django
I have configured everything to work with static in django(static_dirs, static_root,static_url, urls, etc..) but when im running server, styles from 'css/responsive.css' and 'css/jquery.mCustomScrollbar.min.css' are not working. The first two styles work by the way(from 'css/bootstrap.min.css' and 'css/style.css') {% load static %} <!DOCTYPE html> <html lang="en"> <head> <!-- basic --> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- mobile metas --> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="initial-scale=1, maximum-scale=1"> <!-- site metas --> <title>evolve</title> <meta name="keywords" content=""> <meta name="description" content=""> <meta name="author" content=""> <!-- bootstrap css --> <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}"> <!-- style css --> <link rel="stylesheet" href="{% static 'css/style.css' %}"> <!-- Responsive--> <link rel="stylesheet" href="{% static 'css/responsive.css' %}"> <!-- fevicon --> <link rel="icon" href="images/fevicon.png" type="image/gif" /> <!-- Scrollbar Custom CSS --> <link rel="stylesheet" href="{% static 'css/jquery.mCustomScrollbar.min.css' %}"> <!-- Tweaks for older IEs--> <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css" media="screen"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]--> </head> <!-- body --> <body class="main-layout"> <!-- loader --> <div class="loader_bg"> <div class="loader"><img src="images/loading.gif" alt="#" /></div> </div> <!-- end loader --> <!-- header --> <header> <!-- header inner --> <div class="header"> <div class="container-fluid"> <div class="row"> <div class="col-xl-3 col-lg-3 col-md-3 col-sm-3 col logo_section"> <div class="full"> <div class="center-desk"> <div class="logo"> <a href="index.html"><img src="images/logo.png" alt="#" /></a> … -
useState doesn't work, it renders the previews photo of the product
WEBSITE GIF Hello, I am making ecommerce website using react.js and django DRF.. here is the issues.. 1. as you can see the gif, I tried to implement the function that changes the representative picture when I click on the small images using useState.. However, when I refresh the page, the representative picture disappears. when I click the other product, it shows the previews product that I clicked.. Here's my definition of the driving principle. In two actions, call the data from api and store it in each variable. use useState() to render the representative Picture, and when I click other images, useState is going to change the src url of the image.. and having trouble.. I know it is messy and long codes.. please help me.. thank you! django codes are here models.py class Product(models.Model): name = models.CharField(max_length=255, blank=False) category = models.ManyToManyField(ProductCategory) thumbnail_image = models.ImageField(null=True, blank=True) discription = models.TextField(null=False, blank=False) price = models.DecimalField(max_digits=20, decimal_places=2, null=False, blank=False) stock = models.IntegerField(default=0) tag = models.CharField(max_length=255, null=True, blank=True) date = models.DateTimeField(auto_now=True) enable = models.BooleanField(default=True) def image_tag(self): if self.thumbnail_image: return mark_safe('<img src="%s" style="width: 45px; height:45px;" />' % self.thumbnail_image.url) else: return 'No Image Found' image_tag.short_description = 'Image' def __str__(self): return self.name class ProductImages(models.Model): product = … -
from blog.views import (blog_post_detail_page), SyntaxError: invalid syntax
hi I was trying to use run server for my Django app that i have created in my directory that looks like this I was getting this error during runserver from blog.views import (blog_post_detail_page), SyntaxError: invalid syntax ` 1-try_django *src *blog init.py admin.py app.py models.py test.py views.py *tamplest about.html base.html blog_post_detail.html home.html title .txt *try_django.py init.py setting.py urls.py views.py wsgi.py init.py` #my views looks like: from django.shortcuts import render from .models import BlogPost def blog_post_detail_page(request): obj = BlogPost.objects.get(id=1) template_name = 'blog_post_detail.html' context = {"object": obj} return render(request, template_name, context) #blog models: from django.db import models # Create your models here. class BlogPost(models.Model): title = models.TextField() content = models.TextField(null=True, blank=True) #urls : from django.contrib import admin from django.urls import path,re_path from blog.views import (blog_post_detail_page), from .views import ( home_page,about_page,contact_page,example_page) urlpatterns = [ path('', home_page), path('blog',blog_post_detail_page,name='home'), path('page/',about_page), path('pages/',about_page), re_path(r'^pages?/$',about_page), re_path(r'^about/$', about_page), path('example/', example_page), path('contact/', contact_page), path('admin/', admin.site.urls),] -
LEFT JOIN on two Django Querysets
I've been searching SO and Google for two days now and haven't found a solution to my specific problem. I have a SQL query that I am trying to convert into Django ORM (if even possible). In SQL, the query looks something like this: SELECT * FROM( SELECT max(effective_date) AS effective_date, floorplan_id FROM floorplan_counts GROUP BY floorplan_id) s1 LEFT JOIN ( SELECT floorplan_id AS fc_floorplan_id, units AS fc_units, beds AS fc_beds, expirations AS fc_expirations, effective_date FROM floorplan_counts) s2 ON s1.floorplan_id = s2.fc_floorplan_id ) I am able to use Django ORM to generate subqueries s1 and s2: s1 = FloorplanCount.objects.values('floorplan_id').annotate(effective_date=Max('effective_date') s2 = FloorplanCount.objects.values('effective_date').annotate( fc_floorplan_id=F('floorplan_id'), fc_units=F('units'), fc_beds=F('beds'), fc_expirations=F('expirations')) Currently, the solution I have in place is using Django .raw(), but would like to use Django ORM. Also would like to not use .extra() since documentations says it will be deprecated in the future. How can I left join s1 to s2? -
Find odd and even and both values
It takes an input n and outputs the numbers from 1 to n. For each multiple of 3, print "Hello" instead of the number. For each multiple of 5, prints "World" instead of the number. For numbers which are multiples of both 3 and 5, output "HelloWorld". -
django-import-export - Export one to many relationship with ForeignKeyWidget - returns an empty Field
I am trying to use the dajngo-import-export package to export data from two tables with a one to many relationship. I have a custom ForeignKeyWidget class that overrides the get_queryset method. The problem is that the export returns an empty field - no errors, just an empty field. I also tried just using the ForeignKeyWidget without the custom class/get_queryset - but I get the same result. Does anyone see what I'm doing wrong here? #admin.py from import_export import resources from import_export.fields import Field from import_export.widgets import ForeignKeyWidget class SlateDocResource(resources.ModelResource): actbreaks = Field( column_name="actbreaks", attribute="id", widget=ActBreaksForeignKeyWidget(ActTimecodes, "slatedoc_id"), ) class Meta: model = SlateDoc fields = [ "actbreaks", ] class ActBreaksForeignKeyWidget(ForeignKeyWidget): def get_queryset(self, value, row, *args, **kwargs): qs = ActTimecodes.objects.filter(slatedoc_id=self.pk) print(qs.values()) return qs #models.py class SlateDoc(models.Model): #primary Model - fields not listed here. class ActTimecodes(models.Model): #Secondary model - every slatedoc can has multiple instances of ActTimecodes slatedoc = models.ForeignKey( SlateDoc, on_delete=models.CASCADE, related_name="acts" ) act_number = models.IntegerField(verbose_name="Act", default=1) tc_in = models.CharField(max_length=11, default="00:00:00:00") tc_out = models.CharField(max_length=11, default="00:00:00:00") dur = models.CharField(max_length=11, default="00:00:00:00") objects = ActTimecodesQuerySet.as_manager() class Meta: ordering = ["act_number", "tc_in", "tc_out"] #version info "python_version": { "version": ==3.10" } "django": { "version": "==4.1.1" }, "django-import-export": { "version": "==2.8.0"}, -
Gunicorn Nginx Django static files
I've been digging through articles and posts about this subject but can't seem to get my images to load. For some reason the CSS on my pages seems to load just fine. DJANGO settings.py file BASE_DIR = Path(__file__).resolve().parent.parent STATIC_URL = '/static/' I've tried: STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_ROOT = '/var/www/myname/' HTML Page <img src="{% static 'picture.jpg' %}" class="img-fluid"> NGINX /etc/nginx/sites-enabled/django_project server { listen 80; server_name mywebsite.com; location /static/ { alias /var/www/myname/static/; } } DIR TREES /var/www/myname └── static └── admin ├── css │ ├── styles1.css │ └── styles2.css ├── images │ ├── picture.jpg │ └── python.jpg └── js └── scripts.js /home/myname/myprojectdir ├── django_project │ ├── django_project │ │ └── __pycache__ │ ├── etc │ ├── index │ │ ├── migrations │ │ │ └── __pycache__ │ │ ├── __pycache__ │ │ └── templates │ │ └── index │ │ └── backups │ ├── __pycache__ │ └── static │ ├── admin │ │ ├── css │ │ │ └── vendor │ │ │ └── select2 │ │ ├── fonts │ │ ├── images │ │ │ └── gis │ │ ├── img │ │ │ └── gis │ │ └── js │ │ ├── admin │ │ └── vendor │ │ … -
Publishing on heroku
I uploaded my website, created in the django library, to heroku using this guide - https://habr.com/ru/post/523308 /. And when I go into my application, I see the inscription "Application error or There's nothing here, yet". I am a beginner and for the first time I upload a website to hosting and admit that I have not seen or done something, please help. For convenience, I uploaded the code to this repository - https://github.com/krutpik/help enter image description here Here is the error that appears when running in the console - at=error code=H10 desc="App crashed" method=GET path="/" host=serene-journey-43437.herokuapp.com request_i d=f44421b6-9192-423c-9710-72cbedfdd348 fwd="87.117.61.239" dyno= connect= service= status=503 bytes= protocol=https – -
How to reference an object in a class using a decorator
I have a list of dicts defined in setUpClass in a Django TestCase: class MyTest(TestCase): @classmethod def setUpClass(cls): myobj = MyModel.objects.create() MY_LIST = [ ({ 'key1': {'a': myobj.id, 'b': 2}},), ({ 'key2': {'a': myobj.id, 'b': 2}},), ] How do I reference MY_LIST using parameterized? E.g. @parameterized.expand(MyTest().setUpClass().MYLIST): def test_mytest(self, dict_item): print(dict_item.items()) Results in AttributeError: 'NoneType' object has no attribute 'MYLIST'. -
adding info in django many-to-many table
I created many-to-many connection in models.py between two tables and the third one appeared. I've stuck into the problem that i dont know how to add some info to this table. I've been trying to import this table in shell mode but i dont know how to do it. For instance, to change table based on class 'User' i wrote: from club.models import User new = User(name='Maksym') new.save() So i'm interested in how to add some info in the table 'club_event1_users', i have attached screenshots -
In the views.py when we insert models or forms why we don't use "from . import models" instead of "from .models import Model1,Model2?
we import views in urls.py urls.py from django.urls import path from . import views urlpatterns = [ path('',views.index,name='index'), path('posts',views.all_posts,name='all'), path('posts/<slug:slug>',views.post_details,name='post_details') ] in views.py models and forms are imported like views.py from django.shortcuts import render from .models import Post,Author,Tag,Comment from .forms import CommentForm def index(request): posts = Post.objects.all() print(posts) return render (request,'mblog/index.html',{'all_posts': posts}) def all_posts(request): posts = Post.objects.all() return render (request,'mblog/all-posts.html',{'all_posts': posts}) -
Creating an Image with Foreign Key to model instance does not return Image URL in serializer.data
I have two models that are connected through a foreign key. An article can have 0, 1 or many images. Both height_field and width_field are autocalculated. is_title_image is set in the POST request. class Article(models.Model): slug = models.SlugField(null=True, default=None, unique=True, max_length=255) heading = models.CharField(max_length=2550) summary = models.CharField(max_length=25500) class Image1(models.Model): height_field=models.PositiveIntegerField(default=0) width_field=models.PositiveIntegerField(default=0) file = models.ImageField(storage=PublicMediaStorage(), height_field='height_field', width_field='width_field') is_title_image = models.BooleanField(default=False) article = models.ForeignKey(Article, related_name='images', null=True, on_delete=models.DO_NOTHING) First I create the article in the DraggableArticleSerializer and use the pk to create the images. Here I am not sure, if this is the optimal way. I use the ImageSerializer to receive all fields from the image instance. Article and image are both being created correctly in the db. But I am not able to use that data in the views.py in order to return it to the frontend. The images property is empty in serializer.data, and serializer.validated_data just returns the input InMemoryUploadedFile: serializer.validated_data['images'][0]['file'] returns OrderedDict([('file', <InMemoryUploadedFile: husky4.jpg (image/jpeg)>), ('is_title_image', True)]) I dont know how my view should be changed from the regular CreateAPIView. Do I have to give some extra data to serializer.save() or is my problem located somewhere else. class DraggableArticleSerializer(serializers.ModelSerializer): images = ImageSerializer(many=True, required=False) class Meta: model = Article fields = … -
Paginator works slow
I work with large database (over 23,000,000 records) and find out that Django Paginator works too slow. So basically is it a problem with database (perhaps, we should do some optimizations in db) or Django Paginator is a bad solution in this case?