Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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, ...
Antokios's user avatar
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. ...
Taek's user avatar
  • 131
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 ...
saran3h's user avatar
  • 235
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 ...
Naveen Jain's user avatar
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 ...
saran3h's user avatar
  • 235
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: ...
Jessica Chambers's user avatar
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, ...
Helana Brock's user avatar
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....
Lorenzo Fiamingo's user avatar
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: ...
Wizard's user avatar
  • 449
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 ...
Arun's user avatar
  • 121
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 ...
thumbtackthief's user avatar
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 ...
thumbtackthief's user avatar
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 ...
thumbtackthief's user avatar
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 ...
crazy_sec's user avatar
  • 131
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....
Sebastian Olsen's user avatar
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: ...
Sachi Tekina's user avatar
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, ...
amazingbasil's user avatar
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 ...
ZAD-Man's user avatar
  • 247
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 (...
Martol1ni's user avatar
  • 173
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 ...
thumbtackthief's user avatar
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. ...
broinjc's user avatar
  • 375
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 ...
tr33hous's user avatar
  • 205
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 ...
kevins's user avatar
  • 131