Questions tagged [django]

Django is a Python-based framework for creating web applications.

67 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
15
votes
0answers
7k views

Django Rest Framework - add/remove to a list

I have a model Collection which has a many to many relation to a model Item. I want to be able to add or remove items to this collection using Django Rest Framework. Option1 - make an action: ...
8
votes
0answers
830 views

Django on virtual machine - watching changes in static files and autocompiling LESS without inotify

I'm setting up a Django development environment using Vagrant to run an Ubuntu virtual machine on VirtualBox. As this is a student project run mostly be very amateur coders and I want everyone to be ...
7
votes
0answers
559 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
0answers
497 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
0answers
41 views

Querying all items that are in a many-to-many relationship with a child of an object

I have the following Django models setup: ...
4
votes
0answers
1k views

Sending notifications with Django channels

I have project on Django wich use Django Channels. I use Django Channel for sending notifications to users who are subscribed to articles changes (adding/editing/deleting comments on article). So I'...
4
votes
0answers
328 views

Python Class to represent a Pokemon

I have been programming with Python on-and-off for about 2 years now, even now I still find that when I look at other applications I struggle to follow along with their classes/objects. Please help me ...
4
votes
0answers
572 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
0answers
79 views

Duplicate vote checking

I am new to Django and added a vote duplicate check to the tutorial application. I set a cookie in the vote view: ...
4
votes
0answers
2k views

Django form validation based on the contents of uploaded files

I have a Django form with a lot of fields, including some FileFields. I want to validate the form based on the contents of the files: they must be valid gdal datasets, and if both are present (one of ...
3
votes
0answers
45 views

Django project for events of the day, grouped by keywords in common

I have made a website where people write about their day and see it analyzed. In particular, the website takes event titles and groups them together if they have any common words (after stemming the ...
3
votes
0answers
95 views

ProfileForm that collects extra fields on User Signup

I have a signupView that shows 2 forms: SignUpForm and ProfileForm. Basically, ...
3
votes
0answers
474 views

Simple auction application in Django

I'm learning backend dev and python and django1. My first app is a basic auction site. Users sign up, submit an auction, and other users bid on the auctions. I would highly appreciate any ...
3
votes
1answer
62 views

Two cases for indicating consent for a ticket

I have two cases here: the person who ordered a ticket clicks on "Permission" and the OrderConsentUpdate View updates the database. is the attendee him- or herself ...
3
votes
0answers
1k views

Django shopping cart, and testing

For an e-commerce web application I have written a shopping cart, and some tests for it. I have used a course on Lynda.com, on building an e-commerce website, as inspiration on how to build the ...
3
votes
0answers
3k views

Django 'Like' functionality for a post

I am implementing a like button for posts (Using a clustom Like model and the pre-defined User model from django.contrib.auth). Would appreciate hearing how I can improve this code. Also, I am ...
3
votes
0answers
669 views

Testing a Django password reset procedure

I am writing tests for the password reset flow. It involves emails, links to reset the password etc so I made a really long test. It is testing quite a lot of things. If I break up the tests then the ...
3
votes
0answers
36 views

Django-Python Db-access optimization

Is is possible to make this function more efficient and possibly more readable? In addition, Am I doing this right? I mean, it works, but would it be better to do a complex query (with annotations) ...
3
votes
0answers
143 views

Converting YouTube channels to podcasts

I created a Django app that converts YouTube channels to podcasts. It uses the actual YouTube paths for the URLs. The idea is that the user can just find the YouTube address of the desired channel (...
3
votes
0answers
649 views

Working with multiple currencies in Django

I'm working on a project where user adds many products and compare their prices, average price, minimal and many other statistics. There are two currencies for now, EUR and CZK. I'm here to ask ...
3
votes
0answers
80 views

One user profile for company and person

I'm creating a web page which has two types of users with very similar permissions: Person and Company. The main difference is ...
3
votes
0answers
1k views

Implementing “day wise task management” system using Django and AngularJS

I have a Task model in Django which looks like the following: ...
2
votes
0answers
59 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 ...
2
votes
0answers
29 views

Automatically filled multiple forms in one view

I have some question because in my project I have 4 models, and one of models is parent for other 3 and they are connected to parent by foreign key. Then I have view which is used for automatically ...
2
votes
0answers
42 views

Web app that triggers sirens on cameras in remote locations

Web-app summary: I'm a complete beginner in web development and I made a sample web application that can trigger sirens on security cameras located in remote locations. Here's the functionality seen ...
2
votes
0answers
92 views

Django authentication against Exchange server

I wrote an authentication app for Django and my worry is primarily about the security of my app. My Django authentication app uses exchangelib to authenticate ...
2
votes
0answers
291 views

Django Restframework: Writable nested serializer with custom behavior

Context I am trying to get some practice with Django and Django REST framework. As a toy example I want to set up a server to which I can POST results of automated test runs. In the simplest version, ...
2
votes
0answers
61 views

Python/Django Class based saving

I'm creating multiple Django apps with vote possibilities, so I made an app vote to handle all this votes. In my templates I'm including an ajax-function named <...
2
votes
0answers
77 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....
2
votes
0answers
157 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 ...
2
votes
0answers
37 views

Making zip file with custom content per user

What I tried to do: In my main project folder I have directory downloadable_app with these files/folders inside: index.html js/app.f54b97d7097bcf4226c0.js I need ...
2
votes
0answers
670 views

Django Rest Framework ListAPIView - many if-s in get_queryset()

Please review my DRF ListAPIView code. There are a lot of if statements. I wonder if it's a good approach to put these if-s in <...
2
votes
0answers
604 views

Apply a series of functions on Django querysets using decorators

Let me first show my models : ...
2
votes
1answer
172 views

Cleaning service API using Django REST framework

I am trying to write a cleaning service API using the Django REST framework, but I think how I defined this model is not robust enough for production and in turns will make any application using this ...
2
votes
0answers
219 views

Django view for both AJAX and normal request

I'm starting with new project where there will be used to delete product using AJAX, but sometimes with normal request. What do you think about this view? I'm trying to make it as universal as ...
2
votes
0answers
182 views

A Django EAV attempt

This seems to do the job of the EAV tables. Besides being EAV, is there room for improvement? Maybe there is something obvious, but how about indexing certain columns? ...
2
votes
0answers
54 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 ...
2
votes
0answers
49 views

Platform to buy services, where you can receive notifications

I am developing a website, where people can buy services, also it has a notification system; I do this in views to show log in and sign up, on index.html. views.py ...
2
votes
0answers
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 ...
2
votes
0answers
377 views

Task for all objects in model with datetime operations

I created this quite important piece of code, but I am not pretty sure is it good enough. Goal: I have a big task for a database and have decided to use Django-Celery. I want to go through all ...
1
vote
0answers
30 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 ...
1
vote
1answer
31 views

Custom model to count user interaction in application

In language dictionary application users can add new words and do other staff with this word such as adding additional information to the word (description, etymology, speech parts, noun class etc.) I'...
1
vote
0answers
22 views

Trigger sirens on cameras in remote locations

Web-app summary: I'm a complete beginner in web development and I made a sample web application that can trigger sirens on security cameras located in remote locations. Here's the functionality seen ...
1
vote
0answers
42 views

Putting a multichoicefield under a dropdown button

I am building a web app in Django where one of the form fields is a multiplechoicefield from a many2many object that I use to select users that are allowed to edit the post. In standard form the field ...
1
vote
0answers
80 views

Django model and views to summarize and plot an uploaded CSV

I have a simple web application where a user uploads a CSV of some dataset and some summary statistics and box plots are displayed. I heard that it is better to have so called skinny views and fat ...
1
vote
0answers
726 views

React + Django (session) authentication

Is authentication implemented correctly? At the entry point to the app, which is App.js, query the Django server, which responds whether the current user is ...
1
vote
0answers
24 views

Django template for “no more discount codes” and “expired discount code” situations

I have the following code in my Django template. It's a bit repetitive. I wonder if that's good the way I wrote it, or if you would combine these two 'if'-statements into one somehow? ...
1
vote
0answers
110 views

Model architecture in Django

I am developing a project with various tables so I can have better understanding of model relation by communicating with the experts. Can anyone look at my code and see if I have designed my models ...
1
vote
0answers
2k views

Django model for an inventory management system

The usecase of my app I am trying to build is about Inventory Management System for a single company. I have attached a layout depicting what table or model should look like. I have designed the model ...
1
vote
0answers
65 views

Determine serializer on per-action basis for DjangoRestFramework ModelViewSet

I have a Profile object with two fields. One is safe for the public to see, while the other contains private data. ...