All Questions
Tagged with django performance
23 questions
5
votes
1
answer
99
views
Twitter contact scraper with Tweepy & Django
I created a project for academic purposes that works on Twitter data. It should:
Get all friends and follows of the user
Store them in MongoDB
Display them in a table
I'm using django + plain HTML, ...
3
votes
0
answers
55
views
Django migration script to add metadata
I made a simple django migration that adds two field to our Invoices model : first_payment and first_paying_month.
...
4
votes
1
answer
84
views
Periodically synching data from an API to database is extremely slow
I have a scheduled task where I synch all the data from one table (via an API) to another. There are about 10,000 rows that are being updated and the new ones get created. This is what I came up with ...
1
vote
0
answers
48
views
Listing all related details of a model object through Django ORM
How can my solution be improved / optimized?
explaination of db models :
thinkpad is a equipment of laptop subcategory.and ...
1
vote
1
answer
73
views
Code improvement suggestions for cost calculation [closed]
I have to calculate costs based on country code and city(optional). There is also a condition that countries in Asia have separate pricing logic depending on both country and city and they are stored ...
2
votes
2
answers
129
views
Optimising two for loops in Python
I would like to make this code more efficient, I have isolated the problem as being these two for loops:
...
1
vote
1
answer
239
views
Django view of reward points that heavily filters and sorts (many) database results
My page (even when it has no data) takes 10+ seconds to load. That's just too long, considering when you finally get to it there's no data. When it has data, it takes even longer.
Here is my view, ...
2
votes
0
answers
106
views
Generate automatically new groups in a tournament
I'm trying to model a tournament with Python (Django) and I've got a function that assigns teams of the previous stage to the groups of the new one.
The teams in the first stage are assigned manually....
2
votes
0
answers
131
views
An asynchronous solution to send validation email [closed]
I intend to send validating message to User's email to complete a registration with the following codes:
...
2
votes
0
answers
232
views
Django social network application - database schema
I am writing a simple social media application in Django. I would like to know whether the following model structure is correct, or how can I improve the schema to get better performance. Do I need to ...
0
votes
1
answer
411
views
Django query to find all items without a FK relationship except for excluded list
I have a Book model and an Author model that has a FK relationship to Book (I realize that ...
2
votes
1
answer
31
views
Scraping website for book listings, checking if database contains relevant listings, and displaying result in a Django view
This code works but is very slow. I am scraping a website for urls for various books, and then checking to see if we have complete records of those books in our database. After I process the URL to ...
2
votes
1
answer
2k
views
Speed up performance of nested for loops to get all related format of all Authors' Books
This works but is very slow. I have an Author table that foreign keys to all books by that author. Each book has a variety of formats it can appear in (html, pdf, etc), which its linked to by its ...
3
votes
1
answer
2k
views
Django REST Framework - PDF Generator
I created a new endpoint for an API (Django REST Framework) that generates a PDF from an HTML template. I follow the example from the plugin django-easy-pdf.
It's working, but I would like to improve ...
3
votes
1
answer
556
views
Storing database references to files/media
This is an extension of this question due to it not covering an important role of my setup that I think needs more attention.
The files are stored on a different server for separation and convenience....
1
vote
1
answer
79
views
Determine what hazard type does the building belong using GeoDjango Intersects
Below is my query to identify what hazard type does the buildings belong:
...
0
votes
1
answer
185
views
Dynamically calculate status in MLM
Problem: dynamically calculate status in MLM only based on a structure.
It works correctly but it's so slow. Only test processing takes about 20 seconds. I tried to replace some lists by generators, ...
3
votes
2
answers
2k
views
Django ListView with MySQL query for the queryset
(Note: Even if you don't know Django, it's probably the query that needs work anyway, so you probably don't need to know Django/Python)
I have a ListView that ...
6
votes
2
answers
213
views
What are the latest Odds?
The main problem the following query is solving, is the following:
Each Offer has multiple Odds (...
10
votes
1
answer
198
views
Speed up my search
I have a django app with search powered by haystack. The general search goes very quickly, but I need to filter the results by their model type. It works but is very slow. I've never really worked ...
4
votes
1
answer
70
views
Code efficiency with many records
I have a bunch of functions that return strings based upon score ranges. Then I have another function that sums everything up and assigns a numeric weight.
...
10
votes
2
answers
8k
views
Faster Django CSV generation for several million database entries
I am writing a CSV file generator that's filtering through about seven million database entries (MySQL backend). This part is especially slow and I was wondering if there is a way to make it much ...
3
votes
1
answer
638
views
Storing folders of list of records in Google Drive
I've written a script using the Django ORM to store 'configuration settings' and interacting with the Google Drive API and another API. The script creates a base project folder and subfolders in ...