Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
35 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
0answers
17 views

Django templating practices

I'm working with Django the last year and I am a bit confused about the best/common practices on templating. My focus is to keep the code DRY but also reusable, maintainable, understandable and also ...
0
votes
0answers
60 views

How to connect a python desktop application and a Django website to communicate data each other?

I am making a Basic Django website that takes a name and score input from a user and shows the highest ranked player. I have a python desktop application and would like to auto send the username and ...
1
vote
0answers
28 views

How to visualize events? (UML/Django)

I work in Django web framework. When a project gets bigger, I have the same problem again and again. There is some Model. This model needs to have another objects connected. For example when User is ...
0
votes
1answer
446 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
0answers
168 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
88 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
87 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, ...
0
votes
0answers
50 views

Smartest way to setup testing in Python/Django

So I am about to start my final traineeship as starting Software Engineer (and Tester in this case) but I am in a bit of a pickle. The company has developped their own CMS system with Python/Django. ...
1
vote
1answer
273 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
316 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
144 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
113 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
656 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
521 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 ...
2
votes
2answers
269 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, ...
1
vote
1answer
2k 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
193 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
218 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
304 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
152 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
91 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 ...
1
vote
0answers
256 views

Suggestions on building an authentication system with Django Rest Framework, Mongo and auth0

I am trying to get some suggestions on how I should architect the authentication system for a Django rest framework API. The stack looks like this: Django REST framework Django REST framework ...
3
votes
2answers
549 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
320 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 ...
0
votes
0answers
236 views

Web-app or client based application in Python?

After a few years of using plain but functional Tkinter GUIs in my Python apps, I would like to implement a GUI which is more visually appealing. With abundant website creation templates all over the ...
2
votes
1answer
300 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
54 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
115 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
327 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
342 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
63 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
507 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
144 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 ...
2
votes
1answer
799 views

Nested imports vs. two separate import statements?

Consider these two styles of code that accomplish the same thing: Nested imports common.models from django.db.models import * class SmallAutoField(fields.AutoField): def db_type(self, ...
0
votes
1answer
74 views

Classes for integrating both BitBucket and GitHub into our site (an inheritance and composition question)

I am writing a system of callbacks for BitBucket and GitHub which should modify our site on certain events in BitBucket or GitHub. It is reasonable to make a base class like GitIntegration to handle ...
0
votes
0answers
37 views

Should I implement an intermediate Profile table now, or wait until if/when I need it?

Traditionally the schema is very simple: User <- Post I have written the code for a Profile model to be an intermediate: User <- ProfileUser -> Profile <- Post When registering for the ...
2
votes
1answer
3k views

Using singletons in Python (Django)

I was suggested to define a singleton in Python in the following way: class Controller: pass # ... controller = Controller() However, this way, controller cannot be replaced with a derived ...
2
votes
2answers
1k views

Fully API-based website - is it a good idea?

I sometimes hear about making web-site fully API based, meaning that even in browser the page is constructed based on API endpoint and practically nothing else. One of the benefits I see in this is ...
2
votes
1answer
269 views

Advantages and disadvantages of building web app purely with microservices and hybrid with web framework

Definition: Purely microservice: Not using any web framework such as Spring, Laravel, Zend, Django. Web app is a single page app loading data via Ajax calls to web services Hybrid: The web framework ...
-1
votes
1answer
2k views

Django and websockets: Channels vs Socket.io vs other?

In my Django web app I want to monitor my remote Raspberry PI clients - up to hundreds - using WebSockets: I have to check in their status in real-time (online, working, offline etc.), send commands ...
1
vote
3answers
494 views

How to detect real time change in API response

I have an API endpoint written for version and health of tomcat applications. It returns a json response with details. I wanted to know, how can i monitor any change in the json response in real time. ...
0
votes
0answers
135 views

How to implement user-defined formulas (including arithmetic and if-statements)

Consider the case where a user can save a formula that may include a few predetermined variables. Say these are called words and numbers. An expression in some format might then look like this: if(...
1
vote
2answers
563 views

How to design authorization between docker microservices?

I have 2 micro-services. One is a Django API, the other is a worker. Each one of these lives in side a docker container. The API is a public API for the web front end. It handles CRUD operations for ...
2
votes
0answers
300 views

Dynamic React Application Components - like Django Admin

First, to those who don't know, Django-admin, a decade old applications works as such: You write a class describing the functionality and the expected behaviour of the application: class AuthorAdmin(...
1
vote
1answer
858 views

Populate User info between services on microservices architecture

I'm working on a microservices architecture which contains a couple a REST API as a services and a SPA as an interface. In addition, there are an "special" (is not speacial at all, it just special ...
0
votes
1answer
775 views

Is there a way to control a looping Python script with Heroku?

I have a Python script that continuously makes GET and POST requests to a third-party API at about 1 request per second. It uses a while loop, so the requests all come from the same process. Currently,...
0
votes
1answer
67 views

Is it a bad idea to use Facebook friendships as sole source of filtering content?

I'm writing a social app in Django where all users sign up through Facebook using Python Social Auth. All content that a user sees will be content created by her Facebook friends. Initially, I planned ...
2
votes
0answers
214 views

How to segregate data between user groups in Django?

django.contrib.auth has User and Group models. I'm using the User model for my users, and the Group model to manage their broad permissions (access to admin site, access logs, etc). I also have my ...
0
votes
0answers
245 views

Difference between RAISE and RETURN HTTPResponse in bottle framwork

I am using Bottle framework to implement API's. There is code return before I started, and they use from bottle import HTTPResponse @api.get('/some/api/url') def some_method(...): ... ... ...