All Questions
46 questions
1
vote
0
answers
89
views
Django Google Authentication App using OAuthLib and DRF
Context
I've been working on a Django-based Google Authentication application, designed to manage OAuth authentication without relying on libraries such as ...
2
votes
2
answers
6k
views
Django, filtering on reverse foreign key
We have Projects, which can each have many Entries. We want a report where we see the completion_date of the newest Entry associated with a given Project. However, ...
0
votes
1
answer
188
views
Get Gzip file from endpoint, extract data and add to database
I currently have a script that fires a request to an API endpoint which returns a csv.gzip file - which roughly contains 75,000 rows and 15 columns. I download this ...
3
votes
1
answer
129
views
Django User Model to authenticate using email address and password
This is my second Django project for an actual client and I want some review on one of my important models.
This model will be responsible for authenticating users using their E-Mail Addresses and ...
3
votes
1
answer
546
views
eLearning webapp made with Django
I've been working on probably my biggest project yet, and I'd like you guys to give me some feedback on the code I wrote so far.
It's an eLearning app which offers users a host of functionalities to ...
4
votes
1
answer
620
views
Use django engine to fill in a .html file on storage (no template) and use weasyPrint to convert it to PDF
I 'm new here. I wrote the following django code. I 'm opening, closing files here and saving them temporarily and deleting them. I tried to use Python's tempfile and was getting Permission Error and ...
1
vote
1
answer
41
views
Statistics function
I have created a database using Django. I have a small statistics page as shown below. Can I improve this code?
View file
...
1
vote
0
answers
43
views
normalizing django models
i try to make an app for a mobile store
...
1
vote
0
answers
33
views
Modelling articals and authors in Django
I need to understand if the way I am modelling data in a Django application is correct. The idea is of a news site that has sources, authors and articles.
I want:
...
3
votes
1
answer
85
views
Speed up Python Script to populate MongoDB
How would I go about making this script much faster? Essentially it reads from a file and the slowest part is populating the words. In the words file there are over 100k words and I was looking for a ...
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.
...
3
votes
1
answer
71
views
Django voting implementation
I am creating a translation application and the users can add new translations to the "core" language, e.g. a Latin translation of the German word, and other users can vote on this translation. A ...
4
votes
0
answers
69
views
Download Fasta protein sequences as a file from the selected categories
I have the following function in Django to download the Fasta sequences (protein) through the selected categories as a file. This works well. I would like to improve the following script.
...
3
votes
1
answer
61
views
Script that saving most relevant Youtube video for each database object
Due to the tightened Youtube API daily quota (that allows to use only ~ 98 search requests per project daily) I've implemented a multi-project system. For this to work you need to create a project/...
4
votes
2
answers
86
views
Run the needle program for a query against the subject files and return the result
I have written the script to run locally the needle program for a query against the subject files. It returns the highest percentage result file as a string. In addition it also converts to html file (...
2
votes
0
answers
95
views
Django Dashboard View
What does my code do?
I use Django and in the following snippet, I use a class together with a TemplateView to render an HTML page. I already tried to simplify it with methods, but my code still looks ...
3
votes
1
answer
3k
views
Convert text file to html?
I have a script that converts a text file to html. The text file is an output of a program (needle). The function takes the text file as an input. I am aware the script is awful. I use this function ...
3
votes
1
answer
2k
views
Exporting data from PostgreSQL as CSV to S3 bucket
I have a general question regarding DRY. As you can see there are several parts such as io.StringIO(), csv.writer, ...
0
votes
1
answer
51
views
Simplify small pieces of code with Python/Django [closed]
I'm trying to make a code review for an external developer on my project. His code could be improved and I need your advices in order to know if my overwritten parts are better or not.
Part 1
...
2
votes
1
answer
235
views
Wipe sensitive information from memory in Python
I have come up with the following method to remove sensitive information with the help of the garbage collector:
...
6
votes
1
answer
225
views
NHL Stats web app
There is a web app. My first attempt to use NHL API have been reviewed here.
I'm interested in any kind of refactoring of this code.
But I have some questions that I want to point at specifically.
...
3
votes
1
answer
784
views
Django post function : split method is a good way?
I'm working on my Django project and I'm trying to develop this one with 'Class Based View' (CBV) method in order to keep the code maintainable.
I have a class ...
1
vote
2
answers
136
views
Let's make this Order nicer
Environment details
Python 3.6.5
Django 2.0 (which is not necessarily needed for this review)
Class details
I have a small class which holds 3 staticmethods (I ...
2
votes
1
answer
215
views
Unit tests for os.scandir/scantree a directory
I wrote my first series of test for this simple function:
...
3
votes
1
answer
946
views
Web scraping news articles with Beautiful Soup
It's been nearly a year I've been working with C++ and now I am diving in Python and its libraries and frameworks. I am currently creating a website for my portfolio that gathers news articles from a ...
16
votes
0
answers
869
views
Let's register that Django user
Short intro
So, I've been using Django for a while now and thought it would be nice to start a simple application. In an ideal World, each app must have a way of letting its users register and that's ...
5
votes
0
answers
1k
views
Django Project for creating events
Before I continue developing this project, I just wanted to make sure I'm going about creating the views and tests in a "proper manner" or if I am completely fudging this up. Also, is it better to use ...
4
votes
1
answer
67
views
Show furnitures in a different way considering django principle
I want in my homepage to show the furnitures items in a following way:
Newly Arrived Furnitures(upto 10)
Featured Furnitures
Free shipping Furnitures (upto 10)
For this I tried to go ...
2
votes
0
answers
978
views
Apply a series of functions on Django querysets using decorators
Let me first show my models :
...
7
votes
1
answer
177
views
Database modeling for products and store
I am planning to develop a virtual shopping mall where stores of any kind can be registered, such as in a physical shopping mall. First I want to develop an efficient and effective database modeling ...
1
vote
0
answers
536
views
Using 12-Factor Configuration Standard in a Python (Django) Project
I am currently learning practices from the 12-Factor guide using one of the Django apps that I am running in production.
In short, after reading the theory and doing my best to understand the work ...
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 ...
2
votes
1
answer
516
views
Authenticate users in Django
I'm writing a social networking site in Django. I created an account application which is part of site project. I implemented an authentication mechanism in the project. Every user has different ...
5
votes
0
answers
575
views
Django blog application - views, urls, models, forms
I want to learn how to create websites and I have started learning Django web framework. I think Django is very good alternative for PHP and it isn't too complex as JEE. I'm very satisfied learning ...
4
votes
1
answer
664
views
TDD Django - Shopping Cart
I'm new in Python TDD and I would like to ask you about some feedback for Django unit testing.
...
7
votes
2
answers
936
views
Implementation of lru_cache for daily "top categories" query
In my website, I want to show top categories by products' view / sell counts.
Since this is not something changes every hour, I want to fetch real results only once a day from database (may be once a ...
2
votes
1
answer
226
views
customSignupForm code to allow signup for only the invited user
I am developing a feature where the user has to request for invitation if he/she wants to sign up on the site. When the request is accepted by the admin, the user gets to sign up, otherwise it shows ...
6
votes
1
answer
1k
views
Model structure for Player Team and Match in football application
I'm creating an application for foosball matches.
I have models like below:
...
6
votes
2
answers
3k
views
Password generator in Django
I am a system admin, not a developer, so this might be pretty horrible code. This is a password generator. The point of the attempt was to become more familiar with Django at a lower level. I current ...
2
votes
0
answers
71
views
oAuth2 token creation when registering new user
I am working on Django Rest Framework for backend to develop android app. My project is about Food Delivery System.
My app has user login and registration feature. I preferred oAuth2 for token based ...
3
votes
1
answer
3k
views
simple form validation
i've just started to learn python /django ..
im coming from php world ...i mostly struggle with None values which are new to me .. in php i mostly did my boll checking with true/false but in python ...
1
vote
1
answer
139
views
Validating Email Addresses without DB
I wanted to put this out here and see if there were any security vulnerabilities that I'm not seeing. Also, if I can improve performance without sacrificing security, that's always a plus. Thanks in ...
3
votes
2
answers
236
views
Object oriented architecture with an image processing code
This code is python 3X code (in django).
It takes an instance of user entry, and process images: it creates a resized version of original image, 2 thumbs, saves all, and update instance fields to ...
2
votes
0
answers
2k
views
A web crawler for scraping images from stock photo websites
I created a web crawler that uses beautiful soup to crawl images from a website and scrape them to a database. in order to use it you have to create a class that inherits from Crawler and implements 4 ...
15
votes
1
answer
379
views
Modeling a Mage character from nWoD, using Django
Goal
Design a representation of a mage character from the World of Darkness RPG, as well their associated spells.
Here is a visual representation of the schema. You can see it more closely on ...
5
votes
1
answer
189
views
Personal Project for managing Bookmarks - View Part
The code is the view part of my bookmarker - project for managing bookmarks by categories. It uses Python 3.4/Django 1.6. I have also included models.py for ...