Questions tagged [django]

Django is an open source server-side web application framework, written in Python. It is designed to reduce the effort required to create complex data-driven websites and web applications, with a special focus on less code, no-redundancy and being more explicit than implicit.

Filter by
Sorted by
Tagged with
0 votes
0 answers
104 views

How to maintain state for a turn-based game in django

I am using django to develop a turn based chess variant. I just finished using django-channels to create a lobby and match 2 players together. Now, I need to make them play each other and I'm thinking ...
Alex Li's user avatar
  • 109
1 vote
1 answer
315 views

Is storing access token in private data, refresh token in http-only cookie safe?

Backend: Django / Django Rest Framework, would be hosted at GCP k8s Frontend: Angular, would be hosted at some CDN e.g Vercel Authentication: JWT (https://github.com/jazzband/djangorestframework-...
AhmedBilal's user avatar
-1 votes
1 answer
52 views

How to break a bloated decorator into smaller parts in Django?

In a project I am doing, I have to perform a lot of repetitive checks at the beginning of each API end point. As the amount of duplicate code started to grow, I thought of using a decorator to wrap ...
Farzad's user avatar
  • 3
0 votes
0 answers
21 views

Django URL pattern style advice

(!) This is a crosspost, my post did not fit into Code Review. I am building an e-commerce website and I want to serve my products through an API. Each Product has a Product ID and some variants (e.g ...
iman's user avatar
  • 1
1 vote
1 answer
123 views

Django: Is there a reason to separate api calls into their own url endpoints?

I started a project awhile back and have made a lot of progress since then. In the beginning I didn't think much about restful architecture and how I'd serve data to the frontend. Now, however, it ...
noob112233's user avatar
0 votes
0 answers
46 views

In (Django) web application should if-else logic be at a high level (view) or a low level (template)?

Given a (Django) web application following the model-template-view model, when returning a template based on an object should if-else logic be in the view or the template? The API endpoint (view) gets ...
M3RS's user avatar
  • 129
0 votes
0 answers
120 views

How to store multiple-users authorization tokens from a single service if I can't use a persistent storage?

I'm new to "web development" so I don't know much about ways to store data. I'm trying to build a web app using Python-Django which accesses private data from multiple accounts. The data ...
Guillermo Leon Rodriguez's user avatar
0 votes
3 answers
831 views

Optimal method of storing image thumbnails

I'm working on an application with a database containing many recipes. The API is written in Django (with Django REST Framework) and frontend in React.Each recipe is assigned a high-quality image. In ...
gandalf113's user avatar
0 votes
1 answer
304 views

Should I Add Integration Or Unit Tests To Django Views

I am currently exploring adding unit tests to my Django REST Framework project. I totally understand adding unit tests for other components of the app like models. However, I'm stuck at testing views. ...
Daniel's user avatar
  • 11
0 votes
1 answer
504 views

Best way to design multiple paginations in a REST API

Let's suppose that I have a model named Collection. I can create a collection, this collection have two important fields: shared_with_company, shared_list. currently I have an endpoint: /collections ...
Leonardo Furtado's user avatar
1 vote
1 answer
735 views

What is the best way to design calls of post and comments in a rest api?

So, currently I have two models: Post and Comment. Where a post can have multiple comments. I have an endpoint named Posts and an endpoint named Comments that is called to retrieve comments of a post. ...
Leonardo Furtado's user avatar
0 votes
1 answer
235 views

How to Properly Design an API Prefetch System

I'm creating an API for a web service. There are a couple of endpoints in this API that require some time (lets say +5min) to compute, so I'm creating a prefetch system that will call in the ...
Stack's user avatar
  • 151
-3 votes
1 answer
77 views

Creating a Django web-app with Sage 200 Database

I have been asked to create a Django/Python web app that creates web-based, .pdf and excel reports from a Sage Evolution database. While the sage front-end is still being used. My client essentially ...
Kyle's user avatar
  • 1
0 votes
3 answers
189 views

Fetch the most recently updated records in a database across multiple tables in a performant manner

I have an Angular + Django web application in which Django functions as my backend. In this web application, I have 12 different tables about articles, each table representing a different kind of ...
Philipp Doerner's user avatar
0 votes
1 answer
583 views

Appointments using time slots

I would like to create a dynamic appointment system between teacher and student to easily allow them to make an appointment. In this system, teachers select their 30 minutes time slot availabilities ...
anthonya's user avatar
  • 109
-2 votes
1 answer
765 views

Appointments Booking Using Slots

I'm looking for an efficient way to create appointments between teachers and students. I want teacher to be able of make their students know their availabilities : For example, A Teacher writes on the ...
anthonya's user avatar
  • 109
1 vote
1 answer
326 views

Is microservice approach always best fit for ETL processes?

In our project we are using Django and Django Rest Framework as main application to get/query the data from database and send it to the frontend. Those endpoints are very fast as they should be. ...
Alex T's user avatar
  • 161
2 votes
2 answers
418 views

Reading a large CSV file and then loading data to a DB

I have a Django application of 2 GB running and I need to receive a CSV file of more than 1 GB, read it and load the data to a PostgreSQL DB in IBM Cloud. The problem is that if I receive the file, it ...
Elvin Quero's user avatar
3 votes
1 answer
202 views

Distributing Web application to multiple customers

I am building an app (stack is Python/Django/React and DB is PGSQL) that is supposed to be used internally in companies to track their work, assign people to different tasks, throw some statistic data,...
Freshman's Dream's user avatar
3 votes
2 answers
2k views

Communication between two apps

I am thinking of creating two applications, one of which (App 1) will be in Django (DRF) and other (App 2)might be Django but might be another more lightweight framework (maybe Flask or plain Django ...
Alex T's user avatar
  • 161
1 vote
2 answers
288 views

Best Practice: Should cascading updates be handled by the frontend or the REST API?

I am designing a timesheet app for logging user tasks using React for frontend and Django REST Framework for backend. The database is PostgreSQL and I have a table for recording the tasks with 4 ...
Alvin's user avatar
  • 19
0 votes
2 answers
73 views

What's the right way to handle authentication of users across 2 web applications

There are 2 independently functioning web applications. Web-app1: (Flutter+Django+Postgres). Web-app2: (Angular+Spring+Postgres). Each of the web-apps has its own user database and are functioning ...
mAsK's user avatar
  • 3
0 votes
1 answer
174 views

Is it good practice to use the Django template system and/or its admin site for commercial applications?

As a beginner to web applications and front end stuff, I'm really confused about if it's good practice to use the Django template system and its admin interface in commercial applications. As far as I ...
bwdm's user avatar
  • 103
0 votes
0 answers
279 views

Best route for multiple user roles with toggleable permissions with React and Django Rest Framework

What is the best way to create dynamic user roles that can have toggleable permissions? I am currently creating my very first website which has a react front end with redux toolkit and redux saga and ...
Asif333's user avatar
-2 votes
1 answer
154 views

Use 1 to many relationship on same model or split it into two different models?

I'm building a forum application using the Django web framework but I'm not sure how to design the entity relationship diagram when it comes to the Post model. Since one Post can have many replies, ...
flyingfishcattle's user avatar
2 votes
2 answers
749 views

How should I structure my database entities with invites and recipients for e-signing web app?

I am interested in implementing the following requirements for my e-signature web application. A user can create a new signing contract. That contract can include multiple users to sign. The contract ...
Viktor Vostrikov's user avatar
-1 votes
2 answers
324 views

What makes LINQ (C#) unique compared to another DSL such as Django query syntax?

My question to the community is this: What makes C#'s LINQ Unique from other query language in other languages and frameworks, or does it not have anything to make it unique at this point? ...
Kayden Miller's user avatar
2 votes
1 answer
823 views

Best approach for developing a stateful computation-heavy application with a rest-api interface using python?

I want to develop an end-to-end machine learning application where data will be in GPU-memory and computations will run on the GPU. A stateless RESTfull service with a database is not desirable since ...
ardaasik's user avatar
1 vote
2 answers
527 views

Understanding the importance of Gunicorn and Nginx for Django web development

I'm entirely uninitiated to the world of web development, and only have a tentative grasp on Django and web development through the test server it works through. From the guide I'm reading, the author ...
genjong's user avatar
  • 113
0 votes
1 answer
275 views

How to efficiently communicate with Raspberry Pi using Django/Python

I have a raspberry pi that is sending an https request to my Django application every 2 seconds. The request is essentially asking the application 'Has a user requested data from me?' My Django ...
MattG's user avatar
  • 103
0 votes
1 answer
75 views

Email Notifications Implementation - Web Application

Good day, I'm having difficulty structuring how I should set up email notifications for a Django app that I built. As I'm seeing an increase of users in the app, it increases the occurrence of email ...
Paolo's user avatar
  • 101
-3 votes
1 answer
131 views

REST API Testing best strategy

I'm currently developing a personal project using Django REST + React and as it grows more complex, I want to add unit testing to ensure that changes don't affect previous functionality. However, I'm ...
Antonis Karvelas's user avatar
-4 votes
1 answer
81 views

Keeping JSON in database

I'm trying to create web app(flask or django-rest) that would scrape some data and save it to JSON so that it can be viewed in the frontend (VueJS). I'm wondering if it is better to save the scraped ...
Alex T's user avatar
  • 161
-1 votes
3 answers
167 views

Can I manage thousands of concurrent connections with a non-Node stack?

I'm developing a social network with Django (Python) + Postgres SQL. My site will have a chat feature so that users can communicate to each other in real-time, and the communication will be only from ...
Fran's user avatar
  • 9
1 vote
1 answer
75 views

Scraper in separate repo from visualization component?

Let me explain my thoughts about architecture of the project I'm working on. The project code repository consist of: Scrapy component - of course it serves to scrape data, process it and calculate ...
Bob's user avatar
  • 13
-5 votes
1 answer
305 views

Sync local database with remote

My client has a business which work mostly in remote areas where internet felicity is limited, We have a central database and the branches in remote areas need to connect to the central database. We ...
Jisson's user avatar
  • 93
-1 votes
1 answer
364 views

Is Python's Django WebFramework good to design Expert System as a Web App?

I hope everyone is good. Well, I am at the end of my degree BS (Software Engineering), and in the third Phase of my Final Year Project named as 'Test Phase'. My Project is to build an Expert System ...
Khubaib Khawar's user avatar
2 votes
1 answer
1k views

Should a REST API be used when a websocket is already open?

Background: I was working on a web-socket application integrated into a more conventional http request based website that uses REST APIs. Task: I need to retrieve user history from the database for ...
vonSchweetz's user avatar
0 votes
1 answer
763 views

Double way parent child relationship in Django

I am building an app to register and update children information, this information is to be provided by their tutors. Every child can have multiple tutors, and a tutor can be a tutor for multiple ...
Rodrigo Caicedo's user avatar
2 votes
2 answers
187 views

Architecture to populate graphs from real-time data

I'm developing an application where graphs need to be populated from realtime data. The Real-Time data comes from a Kafka Queue. How should I send this real-time data to the front-end which is in ...
saintlyzero's user avatar
2 votes
1 answer
238 views

Using Django Sessions when views are accessed by API

I'm making an app which is a Django backend and a React frontend (being developed by someone else). The plan currently is to fully decouple the two and have them communicate over API. However, I would ...
Neil's user avatar
  • 219
1 vote
0 answers
16 views

Hypertext Application Language grouping items in a collection

For the purposes of this question I can use an example document straight from the HAL spec, since my problem is very similar: { "_links": { "self": { "href": &...
Neil's user avatar
  • 219
2 votes
1 answer
1k views

Why does the Django Rest Framework encourage separating Model, Serializer and Views for the same object across multiple files?

Summary: Why shouldn't I put model, serializer and view classes for the same object in the same file in my Django Rest Framework application? I'm building an application using the Django Rest ...
Rackamore's user avatar
-3 votes
1 answer
319 views

Why do people keep reusing superclass names in their subclasses?

In my project, I found one of the project's classes reusing the same name as an official one. For example: from django.db import models class Model(models.Model): class Meta: abstract =...
Sarit's user avatar
  • 97
2 votes
1 answer
204 views

Access control to Django App running on private server

I am a self-learning programmer (with a fair share of python knowledge), and currently a company asked to develop a simple application so that they can track employee expenses (and I thought of using ...
drec4s's user avatar
  • 121
4 votes
0 answers
174 views

Should custom Django Admin be separate from client endpoints?

I am currently in the process of creating a Django REST framework project for a client server web app. I would like to ask the following: Should I write a custom admin if I want my app to be ...
 DJN's user avatar
  • 41
2 votes
0 answers
240 views

Use model instance to access model's manager 'objects'

In the Django documentation it's mentioned that Django managers are accessible only via model classes rather than model instances to enforce table and record level operations. What are table and ...
Ujjawal Mishra's user avatar
0 votes
2 answers
169 views

How should I update non-maintained database tables between production and development?

I'm working on a Django web application (with a mySQL back-end) that uses non-maintained tables(tables not modified by the web app). However, I have two copies of the data tables (one for production ...
Sam's user avatar
  • 23
2 votes
3 answers
5k views

How can we make a UML diagram (or something similar) for a project which doesn't contains classes (like non object oriented)?

I am working on a python project and I didn't use classes but created different modules and added functions in them. Now I need to draw a diagram to describe the project/application for a paper. I ...
prime_hit's user avatar
  • 141
0 votes
3 answers
418 views

Url pattern for making a 'like' with a REST API

I have an API route as so: GET /api/item/like Which makes a like object between the logged in user and item object, and it works fine. Is this the correct way to have a user 'like' an object? Or ...
Taimoor Ahmad's user avatar

1
2 3 4 5