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
-2
votes
1answer
60 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 ...
1
vote
1answer
50 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 ...
0
votes
1answer
40 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 ...
1
vote
2answers
66 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 ...
1
vote
1answer
45 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 ...
1
vote
0answers
11 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": "/orders" }, "next": { ...
1
vote
1answer
71 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 ...
0
votes
0answers
30 views

django apps updating another apps model\data

I know django apps should be built to be more or less reusable and not tightly coupled with other apps... But I'm struggling to find best practices for having one app update data in another app ...
-3
votes
1answer
304 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 =...
2
votes
1answer
50 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 ...
2
votes
0answers
30 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 ...
2
votes
0answers
30 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 ...
0
votes
2answers
98 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 ...
1
vote
3answers
764 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 ...
0
votes
3answers
123 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 ...
1
vote
1answer
33 views

Most readable way of generic views placement

What are your suggestions on placing many generic views? Let's consider a classic situation where I have many generic views for CRUD for given models. What is the best way to place them in views.py? ...
0
votes
0answers
40 views

Implementing multiple session support in a chatbot

I am currently implementing a Chatbot purely in python. In my current implementation, each time the user starts a new chat from a session, another Chatbot instance is launched and hence the Chatbot ...
0
votes
0answers
10 views

When user re-navigates to another page current process is stopped. Nginx-Gunicorn-django

I am using Nginx with gunicorn to host my Django app. In development I used the inbuilt python server to host my django app.(manage.py runserver). One of my definition in views.py inputs multiple apks(...
4
votes
2answers
243 views

Does software architecture depend on framework being used?

When I was building my backend API I used Django combined with django-rest-framework (DRF) because it was the easiest and fastest way to create what I needed. And I haven't thought about an ...
2
votes
1answer
141 views

Django - should I create related objects immediately or on demand?

Let's say you have a ForeignKey MyModel.related_model and this related_model has all fields either null=True or default=something. Like User.userprofile which I use on several places in my project. ...
-2
votes
1answer
65 views

Ways to get up to speed understanding an existing Django program

I have just started a new job in which I will be overhauling and updating a web-application written in Django. I have a loose familiarity with Django (and have been reading up on the documentation for ...
1
vote
0answers
45 views

Is there a Django equivalent to Symfony's services?

Symfony has services, which are separate from controllers so that they may be re-used anywhere. Additionally, Symfony services come with dependency injection. Is there a direct analog to Symfony's ...
1
vote
1answer
51 views

Bulk Inserting Data with Duplicates or Line by Line Insertion Without

I am loading a large amount of data (2,000 files with about 30,000 rows, 30 columns) for use in a Django application. The files are based on 40 different templates. The column names are consistent ...
0
votes
1answer
4k views

Break up django monolith into microservices

We currently have a big Django web application: all data is centrally managed by the webapp, via models backed by Postgres. We want to offer access to the data in a more decentralized way, and the ...
0
votes
1answer
516 views

Django Fat Models: Where should I put model creation logic?

I'm reading Two Scoops of Django 1.11. At 7th chapter it introduces "fat models". It says that best practice is to put a big part of logic into the model and keep views as thin as possible, but then ...
1
vote
1answer
112 views

How can I model unknown and an unknown number of attributes on an object?

My example might be slightly contrived, because I've modified it so that the project isn't recognizable by my employer. I'm a newer developer at a very small company. We have an object - Posts - that ...
-4
votes
1answer
92 views

How do I know a product is in the “will_expire” state? [closed]

I am developing a software system and in it there are time-measured products. The customer buys the product for a period of time, such as one month. If the user does not list their products everyday, ...
1
vote
1answer
498 views

REST API for different User Roles in a SAAS application

Need some help in the desing of the Auth/Permissions of a REST API for a SAAS app. I'd done a prototype of a SAAS app and for permissions of the SAAS client, I'd setup the API to request for a header ...
0
votes
1answer
586 views

Refactor Django application - split monolith into REST API and frontend

I am in the process of refactoring a Django web app. It is written in the usual MVT style, and I would like to change this for a REST + frontend approach. In my first iteration I would like to do as ...
1
vote
1answer
152 views

What are the most effective ways to manage rot in your platform's dependencies?

I have a couple of inactive Pinax sites at different versions (0.9.x and 0.7.x). These both started with two common features: While the version of Pinax was the most recent to have a (nonempty) ...
0
votes
1answer
153 views

Django Project for REST endpoints and client view

I have a project where I will be creating certain data models, and managing them. I also want to provide functionality to external clients to access and modify this database. So the question is around ...
0
votes
2answers
1k views

How to secure web services when authentication is done at client side (frontend)

I have web application which structure is as- webapi : django web services [NOT REST] no security implemented frontend : Angular2. authentication implemented via SAML Database : Mongodb Can you ...
0
votes
1answer
997 views

How is/can front- and backend be separated in Django?

I am evaluating frameworks and I would like to understand Django's architecture better. Coming form a Java background I developed components separately namely front and backend. More concretely ...
3
votes
3answers
325 views

What's the proper way to create a list of several slightly different models?

I'm specifically asking about Django here, but I'd appreciate any insight. I'm currently writing up a basic social network. My plan is to allow users to make different kinds of posts (ie text posts, ...
2
votes
1answer
3k views

Django - separation from the frontend (Templates)

Long story short, let's assume I want to create a webpage that would enable the users to sell used cars. I am a beginner to webdev, so pardon my ignorance. Fun fact: two months ago I knew literally ...
1
vote
3answers
273 views

Django web app: how to save thousands of variables per user

There is a website driven by Django where the user logs in and can answer thousands of questions. I want to persistently save whether a given user has answered a given question or not. My approach so ...
2
votes
1answer
302 views

How do I create front end test data based on backend model's schema?

I'm really struggling with creating robust tests for my frontend because of the coupling in data schema between my backend and frontend. To clarify, I have a Django rest API and I have a front end ...
1
vote
0answers
439 views

How to utilize Fat Models practice for Django and Django Rest Framework

I would like to know how experienced programmers and software engineers balance usage of Django's fat models approach against DRF views. In practice, my experience revolves around configuring DRF ...
0
votes
1answer
275 views

Looking for advice on how to implement Likes

I'm using Django and Django-Rest-Framework to build a simple photo sharing app/website and just now getting around to implementing a "Like" system. A couple of options I've thought about (surely there ...
-1
votes
1answer
107 views

How should I handle an object that has copies of another object?

I really hope this is a good place to ask this since the answers might be subjective, but here it my problem: This is probably irrelevant, but I'm working with Python and Django here. I have the ...
3
votes
2answers
577 views

What is the right time to go for Code Refactoring, not optimization?

I've been working on a Python(Django)/JavaScript(AngularJS) based application for some time now.(I learnt all of these on the way, had previously been a Java only programmer)and have hit moments where ...
1
vote
2answers
615 views

Hardcoding on frontend

I have an API which returns a list of articles. An article can have three status: Approved, Pending and Rejected. Now the front-end needs to hit the API in following scenarios: Get all the articles ...
1
vote
1answer
495 views

Data Transfer Between Loosely Coupled Modules of an Application

Let's say we have a rather large project written in Python using the Django framework that is made up of multiple modules (proper term in Django is a project made up of multiple apps, but for the sake ...
0
votes
2answers
60 views

Filtering Deleted Objects

Picture a simple messaging app written in Django. Users have the option to delete messages at any time, but the messages need to be retained in the database. There are two options: A deleted ...
1
vote
0answers
136 views

Many django projects with one admin for all

I have many django projects witch looks the same: there are some Config models and some models user actions Results. The task is to make a one point of Config models contol, keep the history of ...
0
votes
1answer
540 views

Data filtering & requests: fetch all entries or split data?

I am in a situation I cannot decide which approach is the most optimal (performance wise) while being maintainable at the same time (in the sense of having a clear logic). The question is laid in the ...
3
votes
1answer
577 views

Django: caching properties for non-changing entries

I am wondering if it is a good idea to do the following: I have a Django model (which is related to a migration, therefore it has a database entry) with a bunch of properties. Accessing these are ...
1
vote
0answers
66 views

Best way to handle access to web dashboard displayed on “dumb” screen

My web application has a dashboard page written in angularjs that is intended to be displayed on a screen in a room as a way of monitoring the information therein. It's a dumb screen connected up to ...
-1
votes
1answer
992 views

Is it good approach to collecting all logs in memory of a request and dump once?

What I want to Achieve ? I want to dump all logs in a single line which got collected during a request. Why I am doing this? General approach, i.e. logger.info(), dumps log in file at same time ...
2
votes
1answer
175 views

Django database modelling

I'm starting a project with Django, previously I've used Yii and Rails and they have tools that will take a DB structure and build models for you based off the DB structure. From what I've read Django ...